مفاهیم کلیدی را در Tink درک کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
هنگامی که برای اولین بار با Tink شروع به کار می کنید، برخی از مفاهیم کلیدی وجود دارد که باید قبل از شروع سفر خود را درک کنید. این موارد در بخش های بعدی توضیح داده شده است.
بدوی ها
تینک از مواد اولیه به عنوان بلوک های ساختمان رمزنگاری استفاده می کند که یک الگوریتم زیربنایی را مدیریت می کند تا کاربران بتوانند وظایف رمزنگاری را با خیال راحت انجام دهند. یک ابتدایی جزئیات یک الگوریتم رمزنگاری و نوع کلید را تعریف می کند.
Primitives پشتیبانی شده توسط Tink:
- رمزگذاری احراز هویت شده با داده های مرتبط (AEAD) : رایج ترین رمزگذاری اولیه برای رمزگذاری داده ها. برای اکثر نیازهای رمزگذاری مناسب است. AEAD محرمانه بودن متن ساده را فراهم می کند و امکان تأیید صحت و صحت آن را فراهم می کند. به رمزگذاری تأیید شده با داده های مرتبط (AEAD) مراجعه کنید.
- رمزگذاری قطعی: یک رمزگذاری اولیه که همیشه متن رمزی یکسانی را برای یک متن ساده و کلید مشخص تولید می کند. این می تواند مخاطره آمیز باشد، زیرا یک مهاجم برای شناسایی آن فقط باید بفهمد که کدام متن رمزی با یک ورودی متن ساده مطابقت دارد. AEAD قطعی را ببینید.
- امضای دیجیتال : یک نامتقارن (به رمزگذاری کلید نامتقارن مراجعه کنید) برای تأیید صحت و یکپارچگی داده های امضا شده. امضای دیجیتال را ببینید.
- رمزگذاری ترکیبی : رمزگذاری اولیه ای که رمزگذاری کلید نامتقارن و رمزگذاری کلید متقارن را ترکیب می کند (به رمزگذاری کلید نامتقارن و رمزگذاری کلید متقارن مراجعه کنید). رمزگذاری ترکیبی کارایی رمزگذاری متقارن را با راحتی رمزگذاری کلید عمومی ترکیب می کند. برای رمزگذاری یک پیام، یک کلید متقارن جدید تولید می شود و برای رمزگذاری داده های متن ساده استفاده می شود، در حالی که کلید عمومی گیرنده فقط برای رمزگذاری کلید متقارن استفاده می شود. متن رمزی نهایی شامل متن رمز متقارن و کلید متقارن رمزگذاری شده است. رمزگذاری ترکیبی را ببینید.
- کد احراز هویت پیام (MAC) : یک کد اولیه متقارن (به رمزگذاری کلید متقارن مراجعه کنید) برای تأیید صحت و یکپارچگی داده ها. به کد احراز هویت پیام (MAC) مراجعه کنید.
- Streaming AEAD : رمزگذاری اولیه ای که برای جریان داده ها رمزگذاری تایید شده ارائه می کند. زمانی مفید است که داده هایی که باید رمزگذاری شوند آنقدر بزرگ هستند که در یک مرحله پردازش نمی شوند. به پخش جریانی AEAD مراجعه کنید.
برای اطلاعات سازگاری، به نسخه های اولیه پشتیبانی شده بر اساس زبان مراجعه کنید.
برای اطلاعات بیشتر، طراحی اولیه را ببینید.
انواع کلیدی
یک نوع کلید یک ابتدایی خاص را پیاده سازی می کند. اکثر primitive ها دارای چندین نوع کلید هستند که بسته به نیاز شما برای امنیت، زمان اجرا و فضا می توانید انتخاب کنید. به عنوان مثال، AES128_GCM یک AEAD است که برای اکثر نیازها سریع و موثر است. در انواع کلیدهای پشتیبانی شده بر اساس زبان بیشتر ببینید.
دسته کلید و دسته کلید
Tink از مجموعه کلیدها برای مدیریت کلیدها استفاده می کند. مجموعه کلید اساسا مجموعه ای از کلیدها است که چرخش کلید را تسهیل می کند. ویژگی های قابل توجه یک کیست عبارتند از:
- هر کلید در یک مجموعه کلید دارای یک شناسه منحصر به فرد است که در یک مجموعه کلید منحصر به فرد است. این شناسه معمولاً بهعنوان پیشوندی به هر متن رمزی، امضا یا برچسب تولید شده اضافه میشود تا مشخص کند از کدام کلید استفاده شده است (برای اطلاعات بیشتر ببینید که چگونه Tink متنهای رمزی را برچسبگذاری میکند ).
- فقط یک کلید در یک زمان در یک مجموعه کلید اصلی است. یک کلید اصلی در یک مجموعه کلید در حال حاضر کلید "در حال استفاده" است.
- همه کلیدهای یک مجموعه کلید باید پیادهسازیهایی از همان ابتدایی (مانند AEAD) باشند، اما میتوانند انواع کلیدهای مختلفی داشته باشند (به عنوان مثال، کلید AES-GCM و XCHACHA20-POLY1305).
هر پیاده سازی Tink API هایی را برای ایجاد یا ویرایش مجموعه کلیدها فراهم می کند. با این حال، توصیه می کنیم از ابزار CLI خود از Tinkey استفاده کنید.
کاربران روی یک مجموعه کلید با استفاده از دسته کلیدها کار می کنند. دسته کلید، نوردهی مواد کلید حساس واقعی را محدود می کند. همچنین یک مجموعه کلید را انتزاع می کند که به کاربران اجازه می دهد تا یک کلید اولیه را به دست آورند که کل مجموعه کلید را "پیچیده" می کند. به عنوان مثال، شما می توانید یک AEAD اولیه یک مجموعه کلید با کلیدهای N
دریافت کنید. رمزگذاری و رمزگشایی با اولیه به دست آمده سپس از کلید اصلی در مجموعه کلید استفاده می کند.
برای اطلاعات بیشتر، طراحی مجموعه کلید را ببینید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eTink utilizes primitives as fundamental cryptographic building blocks for secure data operations, covering encryption, signatures, and message authentication.\u003c/p\u003e\n"],["\u003cp\u003eKeysets in Tink efficiently manage multiple keys for a single purpose, enabling features like key rotation and supporting various key types within a set.\u003c/p\u003e\n"],["\u003cp\u003eKeyset handles provide a secure abstraction layer, allowing users to interact with keys and perform cryptographic operations without directly exposing sensitive key material.\u003c/p\u003e\n"],["\u003cp\u003eTink offers a diverse selection of primitives and key types, accommodating varying security, performance, and storage requirements, with options like AEAD, digital signatures, and hybrid encryption.\u003c/p\u003e\n"]]],["Tink employs cryptographic building blocks called *primitives*, which define algorithms and key types. These include AEAD, Deterministic encryption, Digital signature, Hybrid encryption, MAC, and Streaming AEAD. *Key types* implement primitives, offering choices based on security and performance. *Keysets*, a set of keys with unique IDs, manage key rotation. *Keyset handles* abstract keysets, providing access to a primitive that operates over the entire keyset, including encryption/decryption with the primary key.\n"],null,["# Understand Key Concepts in Tink\n\nWhen you start working with Tink for the first time, there are some key concepts\nyou should understand before you begin your journey; these are described in the\nfollowing sections.\n\nPrimitives\n----------\n\nTink uses *primitives* as cryptographic building blocks that manage an\nunderlying algorithm so users can perform cryptographic tasks safely. A\nprimitive defines the details of a cryptographic algorithm and the key type.\n\nPrimitives supported by Tink:\n\n- **Authenticated Encryption with Associated Data (AEAD)** : The most common primitive for data encryption; suitable for most encryption needs. AEAD provides plaintext confidentiality, and allows verification of its integrity and authenticity. See [Authenticated Encryption with Associated Data\n (AEAD)](/tink/aead).\n- **Deterministic encryption:** A primitive that always produces the same ciphertext for a given plaintext and key. This can be risky, because an attacker only needs to find out which ciphertext corresponds to a given plaintext input to identify it. See [Deterministic\n AEAD](/tink/deterministic-aead).\n- **Digital signature** : An asymmetric (see *Asymmetric key encryption* ) primitive for confirming the authenticity and integrity of signed data. See [Digital signature](/tink/digital-signature).\n- **Hybrid encryption** : A primitive that combines asymmetric key encryption and symmetric key encryption (see *Asymmetric key encryption* and *Symmetric\n key encryption* ). Hybrid encryption combines the efficiency of symmetric encryption with the convenience of public-key encryption. To encrypt a message, a fresh symmetric key is generated and used to encrypt the plaintext data, while the recipient's public key is used to encrypt the symmetric key only. The final ciphertext consists of the symmetric ciphertext and the encrypted symmetric key. See [Hybrid\n encryption](/tink/hybrid).\n- **Message Authentication Code (MAC)** : A symmetric (see *Symmetric key\n encryption* ) primitive for confirming the authenticity and integrity of data. See [Message Authentication Code (MAC)](/tink/mac).\n- **Streaming AEAD** : A primitive providing authenticated encryption for streaming data; useful when the data to be encrypted is too large to be processed in a single step. See [Streaming AEAD](/tink/streaming-aead).\n\nSee [Supported primitives by language](/tink/primitives-by-language) for\ncompatibility information.\n\nFor more info, see [primitive design](/tink/design/primitives_and_interfaces).\n\nKey types\n---------\n\nA *key type* implements a specific primitive. Most primitives have several key\ntypes to choose from depending on your requirements for security, runtime, and\nspace. For example, AES128_GCM is an [AEAD](/tink/aead) that is fast and\neffective for most needs. See more at [Supported key types by\nlanguage](/tink/supported-key-types).\n\nKeysets \\& keyset handles\n-------------------------\n\nTink uses *keysets* for managing keys. A keyset is essentially a set of keys\nthat facilitate key rotation. Noteworthy properties of a keyset are:\n\n- Each key in a keyset has a unique ID, which is unique within a keyset. This ID is usually added as a prefix to each produced ciphertext, signature or tag to indicate which key was used (see how Tink [tags\n ciphertexts](/tink/design/keysets#tagging_ciphertexts) for more info).\n- Only one key at a time in a keyset is *primary*. A primary key in a keyset is the key \"in use\" at the moment.\n- All the keys in a keyset *must* be implementations of the same primitive (such as AEAD), but can have different key types (for example, an AES-GCM and XCHACHA20-POLY1305 key).\n\nEach Tink implementation provides APIs to create or edit keysets. However, we\nrecommend using [Tinkey](/tink/tinkey-overview) our CLI tool.\n\nUsers operate over a keyset using *keyset handles* . A keyset handle limits the\nexposure of the actual sensitive key material. It also abstracts a keyset\nallowing users to obtain a primitive that \"wraps\" the entire keyset. For\nexample, you can get an AEAD primitive of a keyset with `N` keys; encryption and\ndecryption with the obtained primitive then uses the primary key in the keyset.\n\nFor more info, see [keyset design](/tink/design/keysets)."]]