Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Các API Tink lấy các blob nhị phân tuỳ ý làm dữ liệu đầu vào. Điều này có nghĩa là nếu bạn muốn
mã hoá dữ liệu có cấu trúc, như
bộ đệm giao thức, bạn cần
mã hoá dữ liệu trước.
Mã hoá một protobuf
Cách mã hoá:
Tuần tự hoá protobuf thành một mảng byte.
Mã hoá các byte được chuyển đổi tuần tự, sau đó lưu trữ hoặc gửi bản mã hoá thu được.
Sử dụng:
Lưu trữ các byte được chuyển đổi tuần tự cùng với chữ ký (hoặc MAC).
Để xác minh:
Lấy protobuf được chuyển đổi tuần tự và chữ ký của protobuf đó (hoặc MAC).
Xác minh chữ ký (hoặc MAC).
Giải tuần tự protobuf.
Lưu ý rằng chữ ký hoặc MAC hợp lệ không đảm bảo rằng dữ liệu chính xác
đã định dạng. Việc triển khai phân tích cú pháp dữ liệu phải luôn dự kiến rằng
dữ liệu của bạn có thể bị hỏng.
Bảo vệ nhiều mục dữ liệu
Để bảo vệ nhiều mục dữ liệu, hãy sử dụng phương thức chuyển đổi tuần tự. Thêm tất cả dữ liệu
mục với một protobuf và mã hoá (hoặc xác thực) nó như mô tả ở trên.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2024-10-14 UTC."],[[["Tink APIs accept arbitrary binary data as input, requiring serialization of structured data like Protocol Buffers before encryption."],["Tink provides various encryption methods like AEAD, hybrid encryption, and deterministic AEAD to secure serialized data."],["Tink supports data integrity through digital signatures and MACs, but verification doesn't guarantee data formatting."],["Protecting multiple data items involves serialization, preferably using Protocol Buffers or length-prefixed concatenation, followed by encryption or authentication."]]],["Tink API handles binary blobs, requiring structured data like protocol buffers to be encoded first. To encrypt a protobuf, serialize it to bytes, then encrypt using AEAD, hybrid, or deterministic AEAD methods. Decryption involves decrypting the ciphertext and deserializing the protobuf. To protect from tampering, serialize, then sign or authenticate using digital signature or MAC, storing the signature with the data, verifying the signature before deserializing. Protecting multiple items requires serialization via a protobuf or a length-prefixed method, followed by encryption or authentication.\n"]]