แฮชคีย์ทรัพยากร
แฮชคีย์แหล่งข้อมูลเป็นกลไกที่ทำให้ Google สามารถยืนยันความสมบูรณ์ของ
คีย์การเข้ารหัสที่ปกปิดโดยไม่ต้องเข้าถึงคีย์ดังกล่าว
การสร้างแฮชคีย์แหล่งข้อมูลจำเป็นต้องมีสิทธิ์เข้าถึงคีย์ที่แยกแล้ว ซึ่งรวมถึง
DEK, resource_name
และ perimeter_id
ที่ระบุระหว่างคีย์
การตัดข้อความ
เราใช้ฟังก์ชันเข้ารหัส HMAC-SHA256 ที่มี unwrapped_dek
เป็นคีย์และ
การต่อข้อมูลเมตาเข้าด้วยกันเป็นข้อมูล
("ResourceKeyDigest:", resource_name, ":", perimeter_id)
resource_name
และ perimeter_id
ควรเป็นสตริงที่เข้ารหัสแบบ UTF-8
ตัวอย่างเช่น เมื่อ resource_name = "my_resource"
perimeter_id = "my_perimeter"
และ unwrapped_dek = 0xf00d
ซึ่งเป็นคีย์แหล่งข้อมูล
แฮชคือ
echo -n "ResourceKeyDigest:my_resource:my_perimeter" | openssl sha256 -mac HMAC -macopt hexkey:f00d -binary
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-08-22 UTC
[null,null,["อัปเดตล่าสุด 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"]]