Hàm băm khoá tài nguyên
Hàm băm khoá tài nguyên là một cơ chế cho phép Google xác minh tính toàn vẹn của
khoá mã hoá được bao bọc mà không có quyền truy cập vào khoá.
Để tạo hàm băm khoá tài nguyên, bạn cần có quyền truy cập vào khoá đã khám phá, bao gồm
DEK, resource_name
và perimeter_id
được chỉ định trong khoá
thao tác xuống dòng.
Chúng ta sử dụng hàm mã hoá HMAC-SHA256 với unwrapped_dek
làm khoá và
việc nối siêu dữ liệu thành dữ liệu
("ResourceKeyDigest:", resource_name, ":", perimeter_id)
resource_name
và perimeter_id
phải là chuỗi được mã hoá UTF-8.
Ví dụ: khi resource_name = "my_resource"
,
perimeter_id = "my_perimeter"
và unwrapped_dek = 0xf00d
, khoá tài nguyên
hàm băm là:
echo -n "ResourceKeyDigest:my_resource:my_perimeter" | openssl sha256 -mac HMAC -macopt hexkey:f00d -binary
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-08-22 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-08-22 UTC."],[[["The resource key hash ensures Google can verify the integrity of wrapped encryption keys without needing access to the actual keys."],["Generating the hash requires the unwrapped key, resource name, and perimeter ID used during key wrapping."],["It utilizes HMAC-SHA256, using the unwrapped key as the key and a concatenation of resource details as data for the hash calculation."],["The resource name and perimeter ID need to be UTF-8 encoded strings for the hash generation."]]],["The core mechanism is generating a resource key hash to verify wrapped encryption key integrity. This involves using HMAC-SHA256 with the unwrapped DEK as the key and a specific concatenation of metadata as data. The metadata consists of \"ResourceKeyDigest:\", the UTF-8 encoded `resource_name`, \":\", and the UTF-8 encoded `perimeter_id`. An example shows generating the hash using `openssl` with a sample `resource_name`, `perimeter_id`, and `unwrapped_dek`.\n"]]