MAC 서명은 데이터의 무결성과 신뢰성을 확인하는 데 사용되는 암호화 출력입니다. MAC 서명 알고리즘으로 다음 두 가지 작업을 수행할 수 있습니다.
서명 키를 사용하여 원시 데이터에 대한 MAC 서명을 생성하는 서명 작업
서명 키와 확인할 MAC 태그를 기반으로 메시지의 신뢰성을 검증할 수 있는 확인 작업
MAC 서명의 두 가지 주된 목적은 다음과 같습니다.
서명된 데이터의 무결성 확인
메시지의 진위성 확인
MAC 서명의 목적은 디지털 서명의 목적과 비슷하지만 MAC 서명은 대칭적 암호화에 의존합니다. MAC 태그는 동일한 보안 비밀 키를 사용하여 생성 및 확인됩니다. 메시지의 발신자와 수신자에게 동일한 키가 있어야 MAC 서명을 사용할 수 있습니다.
MAC 서명 사용 사례 예시
키 해시 메시지 인증 코드(HMAC)와 같은 MAC 알고리즘은 효율성이 뛰어난 파일 전송 데이터 무결성 검사 메커니즘입니다. 해시 함수는 임의의 길이의 메시지를 가져와서 고정된 길이의 다이제스트로 변환하여 대역폭 사용량을 최대화할 수 있습니다.
MAC 서명 워크플로
다음은 서명을 만들고 검증하기 위한 흐름을 설명합니다. 이 워크플로는 데이터 서명자와 데이터 수신자의 두 참가자로 구성되어 있습니다.
서명자와 수신자가 특정 공유 MAC 키 사용에 동의합니다.
둘 다 이 키를 사용하여 MAC 서명을 만들거나 확인할 수 있습니다.
서명자는 데이터를 대상으로 서명 작업을 수행하여 MAC 태그를 계산합니다.
서명자가 데이터 및 MAC 태그를 데이터 수신자에게 제공합니다.
수신자는 공유된 MAC 키를 사용하여 MAC 서명을 확인합니다. 확인에 실패하면 데이터가 변경됩니다.
서명 알고리즘
Cloud Key Management Service는 MAC 서명을 위한 키 해시 메시지 인증 코드(HMAC) 알고리즘만 지원합니다. HMAC 알고리즘은 SHA-2 또는 SHA-3 등의 암호화 해시 함수를 사용하여 MAC 태그를 계산합니다. HMAC 함수의 강도는 해시 함수의 강도, 해시 출력의 크기, 키 크기에 따라 다릅니다. HMAC 서명 알고리즘에 관한 자세한 내용은 HMAC 서명 알고리즘을 참조하세요.
제한사항
Cloud KMS를 사용하여 MAC 서명을 만들거나 확인하는 경우 다음과 같은 제한사항이 적용됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-21(UTC)"],[],[],null,["# MAC signatures\n\nA *MAC signature* is a cryptographic output used to verify the integrity and\nauthenticity of data. A MAC signature algorithm lets you perform two distinct\noperations:\n\n- A signing operation, which uses a signing key to produce a MAC signature\n over raw data.\n\n- A verification operation, where the authenticity of the message can be\n validated given the signing key and the MAC tag to be verified.\n\nThere are two main purposes of a MAC signature:\n\n- Verify the integrity of the signed data.\n- Verify the authenticity of the message.\n\nWhile the purpose of MAC signatures is similar to that of digital signatures,\nMAC signatures rely on symmetric cryptography. MAC tags are generated and\nverified using the same secret key. The sender and the receiver of\na message must both have the same key to use MAC signatures.\n| **Note:** Since the sender and the receiver have the same cryptographic material, you can't use MAC tags to prove which of the two signed the file. If you need to be able to verify that the message was signed by the sender, use [digital signatures based on asymmetric keys](/kms/docs/digital-signatures) instead.\n\nExample use case for a MAC signature\n------------------------------------\n\nMAC algorithms like keyed-hash message authentication code (HMAC) are an\nexcellent file transfer data integrity-checking mechanism because of their\nefficiency. Hash functions can take a message of arbitrary length and transform\nit into a fixed-length digest, thus maximizing bandwidth usage.\n\nMAC signing workflow\n--------------------\n\nThe following describes the flow for creating and validating a signature. The\ntwo participants in this workflow consist of the signer of data, and the data\nrecipient.\n\n1. The signer and the recipient agree on using a specific, shared MAC key.\n\n Both can use this key to create or verify MAC signatures.\n2. The signer performs a sign operation over the data to compute a MAC tag.\n\n3. The signer provides the data and the MAC tag to the data recipient.\n\n4. The recipient uses the shared MAC key to verify the MAC signature. If\n verification is unsuccessful, then the data has been altered.\n\nSigning algorithms\n------------------\n\nCloud Key Management Service only supports keyed-hash message authentication code (HMAC)\nalgorithms for MAC signing. HMAC algorithms use cryptographic hash functions,\nsuch as SHA-2 or SHA-3, to compute the MAC tag. The strength of the HMAC\nfunction depends on the strength of the hash function, the size of the hash\noutput, and the size of the key. For more information about HMAC signing\nalgorithms, see [HMAC signing\nalgorithms](/kms/docs/algorithms#mac_signing_algorithms).\n\nLimitations\n-----------\n\nWhen using Cloud KMS for MAC signatures, the maximum file size is 16 KiB for Cloud HSM keys and 64 KiB for all other keys.\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\n- Learn about [HMAC signing algorithms](/kms/docs/algorithms#hmac_signing_algorithms).\n- [Create a key](/kms/docs/creating-keys) with the [`MAC`](/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKeyPurpose.ENUM_VALUES.MAC) key purpose and an [HMAC signing algorithm](/kms/docs/algorithms#hmac_signing_algorithms).\n- [Create a MAC signature](/kms/docs/create-validate-mac-signatures#create_mac_signature) using an existing `MAC` key with a message.\n- [Verify a MAC signature](/kms/docs/create-validate-mac-signatures#verify_mac_signature) using an existing `MAC` key with a message and its signature."]]