להבין מושגים מרכזיים ב-Tink
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כשמתחילים לעבוד עם Tink בפעם הראשונה, יש כמה מושגים מרכזיים שכדאי להבין לפני שמתחילים.
פרימיטיבים
ב-Tink משתמש בפרימיטיבים כאבני בניין קריפטוגרפיות שמנהלות אלגוריתם בסיסי כדי שהמשתמשים יוכלו לבצע משימות קריפטוגרפיות בבטחה. פרימיטיב מגדיר את הפרטים של אלגוריתם קריפטוגרפי ואת סוג המפתח.
פרימיטיבים שנתמכים על ידי Tink:
- הצפנה מאומתת עם Associated Data (AEAD): הדרך הנפוצה ביותר להצפנת נתונים, שמתאימה לרוב צורכי ההצפנה. קובץ AEAD מספק סודיות של טקסט ללא הצפנה ומאפשר אימות של התקינות והאותנטיות שלו. למידע נוסף, ראו הצפנה מאומתת עם נתונים משויכים (AEAD).
- הצפנה דטרמיניסטית: פרימיטיב שתמיד מייצר את אותו מידע מוצפן (ciphertext) לטקסט ללא הצפנה ולמפתח מסוימים. זה עלול להיות מסוכן, כי תוקפים צריכים לגלות רק איזה מידע מוצפן (ciphertext) תואם לקלט נתון של טקסט ללא הצפנה כדי לזהות אותו. ראו קובץ דטרמיניסטי של AEAD.
- חתימה דיגיטלית: אסימטרית (ראו הצפנת מפתחות אסימטריים) כדי לאשר את האותנטיות והשלמות של נתונים חתומים. למידע נוסף, ראו חתימה דיגיטלית.
- הצפנה היברידית: פרימיטיב שמשלב בין הצפנת מפתחות אסימטריים והצפנת מפתחות סימטריים (פרטים נוספים זמינים במאמרים הצפנת מפתחות אסימטריים והצפנת מפתחות סימטריים). הצפנה היברידית משלבת את היעילות של הצפנה סימטרית עם הנוחות של הצפנת מפתח ציבורי. כדי להצפין הודעה, נוצר מפתח סימטרי חדש ומשמש להצפנה של הנתונים בטקסט ללא הצפנה, והמפתח הציבורי של הנמען משמש להצפנה של המפתח הסימטרי בלבד. המידע המוצפן הסופי מורכב מהמידע המוצפן הסימטרי ומהמפתח הסימטרי המוצפן. למידע נוסף, ראו הצפנה היברידית.
- קוד אימות הודעות (MAC): אמצעי סימטרי (ראו הצפנת מפתח סימטרי) כדי לאשר את האותנטיות והשלמות של הנתונים. למידע נוסף, ראו קוד אימות הודעות (MAC).
- Streaming AEAD: פרימיטיב שמספק הצפנה מאומתת לסטרימינג של נתונים. שימושי כאשר הנתונים להצפין גדולים מדי ואי אפשר לעבד אותם בשלב אחד. ראו סטרימינג של AEAD.
למידע על התאימות, קראו את המאמר פרימיטיבים נתמכים לפי שפה.
מידע נוסף זמין במאמר עיצוב פרימיטיבי.
סוגים של מפתחות
סוג מפתח מטמיע פרימיטיב ספציפי. לרוב פרימיטיבים יש כמה סוגי מפתחות שאפשר לבחור, בהתאם לדרישות של האבטחה, זמן הריצה והשטח. לדוגמה, AES128_GCM הוא תקן AEAD שהוא מהיר ואפקטיבי לרוב הצרכים. מידע נוסף זמין במאמר סוגי מפתחות נתמכים לפי שפה.
ערכות מפתחות וידיות לערכות מפתחות
ב-Tink משתמש בערכות מפתחות לניהול מפתחות. קבוצת מפתחות היא למעשה קבוצה של מפתחות שמאפשרים רוטציית מפתחות. מאפיינים ראויים לציון של קבוצת מפתחות הם:
- לכל מפתח בקבוצת מפתחות יש מזהה ייחודי, שהוא ייחודי בתוך ערכת מפתחות. המזהה הזה מתווסף בדרך כלל כקידומת לכל מידע מוצפן (ciphertext), חתימה או תג שנוצרו כדי לציין באיזה מפתח נעשה שימוש (למידע נוסף, אפשר לקרוא איך Tink tags ciphertexts).
- רק מפתח אחד בכל פעם בקבוצת מפתחות הוא ראשי. מפתח ראשי בקבוצת מפתחות הוא המפתח שנמצא בשימוש כרגע.
- כל המפתחות בקבוצת מפתחות חייבים להיות הטמעות של אותו פרימיטיב (כמו AEAD), אבל יכולים להיות להם סוגים שונים של מפתחות (לדוגמה, מפתח AES-GCM ו-XCHACHA20-POLY1305).
כל הטמעה של Tink מספקת ממשקי API ליצירה או לעריכה של מפתחות מפתחות. עם זאת, אנחנו ממליצים להשתמש בכלי ה-CLI שלנו Tinkey.
משתמשים פועלים על קבוצת מפתחות באמצעות נקודות אחיזה למערך מפתחות. נקודת האחיזה של קבוצת המפתחות מגבילה את החשיפה של חומר המפתח הרגיש בפועל. הוא גם מפשט מערך מפתחות שמאפשר למשתמשים לקבל פרימיטיב ש "אורז" את כל ערכת המפתחות. לדוגמה, אפשר לקבל פרימיטיב AEAD של קבוצת מפתחות עם מפתחות N
; הצפנה ופענוח באמצעות הפרמיטיב שהושג ולאחר מכן שימוש במפתח הראשי בערכת המפתחות.
מידע נוסף זמין במאמר עיצוב ערכות מפתחות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[[["\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)."]]