6 important tools in the Cryptography Toolkit:
- symmetric password
- Public Key Password
- One-way hash function
- Message Authentication Code
- Digital signatures
- Pseudo-random number generator
The Mac recognizes tampering and spoofing, which means that both the integrity of the message and authentication can be confirmed.
The input of the message authentication code includes a message of any length and a key shared between the sender and the recipient, which can output fixed-length data, which is the Mac.
A message authentication code is a one-way hash function associated with a key.
Application example of message authentication code
- SWIFT (Society for Wordwide Interbank Financial Telecommunication, World Bank Financial Telecommunications Association)
Between the bank and the bank is through Swift to pass the transaction message. In order to confirm the integrity of the message and verify the message, the message authentication code is used in Swift.
IPSec is a way to add security to the Internet Basic Communication Protocol-IP Protocol (Internet Protocol).
Communication protocols that we use in scenarios such as online shopping.
Realization method of message authentication code
- Implemented using a one-way hash function
Message authentication codes can be implemented using a one-way hash function such as SHA-1, MD5, which is called an HMAC.
- Using a block cipher implementation
Message authentication codes can be implemented using block ciphers such as Des and AES.
- Other implementation methods
A message authentication code can also be implemented using a stream password and a public key password.
Hmac
HMAC is a method of constructing a message authentication code using a one-way hash function, where h is the meaning of the hash.
The HMAC constructed using SHA-1, MD5, and RIPEMD-160 are called Hmac-sha-1, Hmac-md5, and HMAC-RIPEMD, respectively.
Attack on message authentication code
- Replay attack
- How to defend against replay attacks
- Serial number
- Time stamp
- Nonce
- Key speculation attack
Cryptography Beginner Tutorial (v) Message authentication Code mac-message authentication Code