250 likes | 316 Views
Understand public-key cryptography principles, block and stream ciphers, authentication approaches, and algorithms to secure messages. Explore digital signatures and key cryptography applications.
E N D
Chapter 3 Public Key Cryptography and Message authentication.
Introduction • Approaches to message authentication • Public key cryptography principles • Public key cryptography algorithms • Digital signatures
Block vs Stream Ciphers • block ciphers process messages in into blocks, each of which is then en/decrypted • like a substitution on very big characters • 64-bits or more • stream ciphers process messages a bit or byte at a time when en/decrypting • many current ciphers are block ciphers • hence are focus of course Block ciphers work a on block / word at a time, which is some number of bits. All of these bits have to be available before the block can be processed. Stream ciphers work on a bit or byte of the message at a time, hence process it as a “stream”.
Authentication • Requirements - must be able to verify that: 1. Message came from apparent source or author, 2. Contents have not been altered, 3. Sometimes, it was sent at a certain time or sequence. • Protection against active attack (falsification of data and transactions)
Approaches to Message Authentication • Authentication Using Conventional Encryption • Only the sender and receiver should share a key • Message Authentication without Message Encryption • An authentication tag is generated and appended to each message • Message Authentication Code • Calculate the MAC as a function of the message and the key. MAC= F(K, M)
One-way HASH function • Secret value is added before the hash and removed before transmission.
Secure HASH functions • Purpose of the HASH function is to produce a ”fingerprint. • Properties of a HASH function H : • H can be applied to a block of data at any size • H produces a fixed length output • H(x) is easy to compute for any given x. • For any given block x, it is computationally infeasible to find x such that H(x) = h • For any given block x, it is computationally infeasible to find with H(y) = H(x). • It is computationally infeasible to find any pair (x, y) such that H(x) = H(y)
Simple HASH function One-bit circular shift on the hash value after each block is processed would improve
Public-key cryptography principles • A public-key encryption scheme has 6 ingredients • Plaintext: This is readable message or data that is fed into the algorithm as input • Encryption algorithm: The encryption algorithm performs various transformation on the plain text • Public and private key: pair of keys that have been selected where one is used for encryption and other is decryption. • Ciphertext: scrambled message produced as output • Decryption algorithm: accepts ciphertext and matching key and produces the original plain text
Applications for Public-Key Cryptosystems • Three categories: • Encryption/decryption: The sender encrypts a message with the recipient’s public key. • Digital signature: The sender ”signs” a message with its private key. • Key echange: Two sides cooperate two exhange a session key.
Requirements for Public-Key Cryptography • Computationally easy for a party B to generate a pair (public key KUb, private key KRb) • Easy for sender to generate ciphertext: • Easy for the receiver to decrypt ciphertect using private key:
Requirements for Public-Key Cryptography • Computationally infeasible to determineprivate key (KRb) knowing public key (KUb) • Computationally infeasible to recover message M, knowing KUb and ciphertext C • Either of the two keys can be used for encryption, with the other used for decryption:
Public-Key Cryptographic Algorithms • RSA and Diffie-Hellman • RSA - Ron Rives, Adi Shamir and Len Adleman at MIT, in 1977. • RSA is a block cipher • The most widely implemented • Diffie-Hellman • Echange a secret key securely • Compute discrete logarithms
The RSA Algorithm – Key Generation • Select p,q p and q both prime • Calculate n = p x q • Calculate • Select integer e • Calculate d • Public Key KU = {e,n} • Private key KR = {d,n}
The RSA Algorithm - Encryption • Plaintext: M<n • Ciphertext: C = Me (mod n)
The RSA Algorithm - Decryption • Ciphertext: C • Plaintext: M = Cd (mod n)
Other Public-Key Cryptographic Algorithms • Digital Signature Standard (DSS) • Makes use of the SHA-1 • Not for encryption or key echange • Elliptic-Curve Cryptography (ECC) • Good for smaller bit size • Low confidence level, compared with RSA • Very complex
Digital signatures • Bob wants to send a message to alice and wants to maintain secret. • Bob has private key and no one could have created a cipher text that could be decrypted bob’s public key. • This is not possible to alter the message without access. • This emphasis that the encryption process just described does not provide confidentiality. • Even in this case of complete encryption, there is no protection of confidentiality because any observer can decrypt the message by using the sender’s public key.
Key management Public key certificates: • A certificate consists of a public key + a user id of the key owner, with the whole block singed by a trusted third party. • The third party should be a government agency or financial institution Public key distribution of secret keys • Sharing a secret key between 2 parties is the conventional method to share the information