메일 인증 코드 (MAC)
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
MAC 원시 함수를 사용하면 데이터가 조작되지 않았는지 확인할 수 있습니다.
발신자가 수신자와 대칭 키를 공유하면 특정 메시지의 인증 태그를 계산할 수 있습니다. 이를 통해 수신자는 메시지가 예상 발신자가 보낸 메시지이고 수정되지 않았는지 확인할 수 있습니다.
MAC에는 다음과 같은 속성이 있습니다.
- 진위성: 키를 알고 있어야만 검증 가능한 MAC 태그를 만들 수 있습니다.
- Symmetric: 태그를 계산하고 확인하려면 동일한 키가 필요합니다.
MAC은 알고리즘에 따라 결정론적일 수도 있고 무작위일 수도 있습니다. Tink는 현재 비결정론적 MAC 알고리즘을 구현하지 않습니다. MAC은 메시지 인증에만 사용해야 하며, 가상 무작위 바이트 생성과 같은 다른 목적으로는 사용해서는 안 됩니다 (이 경우 PRF 참고).
대신 비대칭 원시 요소가 필요한 경우 디지털 서명을 참고하세요.
키 유형 선택
대부분의 경우 HMAC_SHA256을 사용하는 것이 좋지만 다른 옵션도 있습니다.
일반적으로 다음이 적용됩니다.
최소 보안 보장
- 인증 강도 80비트 이상
- 선택된 일반 텍스트 공격에서 실존 위조에 대해 보호
- 키 복구 공격에 대한 최소 128비트 보안 및 다중 사용자 시나리오 (공격자가 특정 키가 아닌 최대 232개의 키 세트 중 하나를 타겟팅하는 경우)
사용 사례
조작으로부터 데이터를 보호하려고 합니다를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-06-02(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-06-02(UTC)"],[[["The Message Authentication Code (MAC) primitive, using a shared symmetric key, enables verification of data integrity and authenticity by generating an authentication tag."],["MAC ensures authenticity as only the key holder can create a verifiable tag, and it's symmetric, requiring the same key for both computation and verification."],["Tink recommends HMAC_SHA256 for most use cases, while HMAC_SHA512 offers higher security and AES256_CMAC might provide better performance with specific hardware."],["Tink's MAC implementation guarantees a minimum of 80-bit authentication strength, protection against forgery, and at least 128-bit security against key recovery attacks, even in multi-user environments."]]],["MAC uses a shared symmetric key between sender and recipient to verify message authenticity and integrity. The sender computes an authentication tag for a message, which the recipient uses to confirm its origin and unaltered state. MAC guarantees authenticity, where only key holders can create verifiable tags. Key recommendations include HMAC_SHA256, HMAC_SHA512 (most conservative), and AES256_CMAC (fastest with AES-NI). MAC is designed solely for message authentication, offering a minimum of 80-bit authentication strength.\n"]]