Intro to Cryptography Flashcards
(80 cards)
Hash Function
A function that given a byte-stream (file) input will output a fixed length n-bit number called the hash. The input can be any digital file.
Is the hash number for each file unique
No, but its extremely unlikely that two different files will return the same hash. This is called a collision.
Hashing is important for
File security, Data Transfer Integrity, Digital Signatures.
Security in Hash Functions
Preimage resistance: Hard to go back from output to input
Second preimage resistance: Hard to fake a different input that gives the same output
Collision resistance: Hard to find any two inputs that give the same output
SHA-256
most popular hash function. Hashing is one-way, you cannot derive the original document from the hash number. With SHA256 the probability of having two different files with the same output is 1/(2^256)
Uses of Hash Functions
- Data communications, encryption and security
- The hash number of a secret document can be made public because there is no way to get the input from output
- Allows creation of one way password files (store password hash not password)
- Used for intrusion and virus detection
- Used to detect errors or malicious changes in files.
Hash Functions
MD5- output 128bits, collision resistance broken in 2004
SHA1 - previously considered secure, deprecated in 2011
SHA2 (SHA-224, SHA-256, SHA-284, SHA-512) - outputs 224,256,384,512 bits respectively. No real security concerns yet. Used for Blockchain.
Plaintext
original message to be encrypted
Ciphertext
the encrypted message
Enciphering or Encryption
the process of converting plaintext into ciphertext
Encryption algorithm
an algorithm that performs encryption. (Two inputs: A plaintext and a secret key)
Deciphering or Decryption
recovering plaintext from ciphertext.
Decryption algorithm
an algorithm that performs decryption (Two inputs: ciphertext and secret key)
Secret key
same key used for encryption and decryption. Also referred to as a symmetric key.
Cryptography
the art of devising ciphers.
Cryptanalysis
the art of breaking ciphers.
Cryptology
A collective name for cryptography and cryptanalysis.
Cryptanalysis Objective
- Recover Plaintext of a ciphertext or
- Recover the secret key
Cryptanalysis common approaches
- Brute Force Attack
- Non-brute force (analytic) attack, often computationally infeasible
Kerchhoff’s Principle
- All algorithms must be public - only the key should be secret
- A cryptosystem should be secure even if everything about a system except the key is public knowledge.
Weak Encryption
Before 1930s most encryption was weak, meaning they can be easily broken using a PC today by brute force. Encryption is considered strong if the best cryptanalytic algorithm that breaks it is computationally infeasible.
A cipher is unconditionally secure
if it is secure no matter how many resources the attacker has (time, memory)
A cipher is computationally secure
if the best algorithm for breaking it will require so many resources that the cryptosystem is practically secure
Strong Encryption
Algorithm that is computationally secure therefore highly resistant to cryptanalysis. In general all cryptanalytic methods will be NP-hard.