Encryption and Hashing Overview Flashcards
What is PKI?
Public Key Infrastructure (PKI)
what is symmetric key encryption algorithm?
Symmetric encryption means that the data is encrypted on one side using a special key, and then encrypted data is sent to another side and that another side decrypts received data using same key. And again.
Main point here is that those keys here on this side and on this side are the same. That’s why this type of encryption is called symmetric encryption.
what is the drawback of symmetric encryption?
Any person or any machine that owns this key has ability to decrypt encrypted data and gain access to original data. And that is a drawback of symmetric encryption. And if you want to use it somewhere for encryption of your data, you should take care of key and key should be kept secret and it should not be transferred to any other machines or send to other people.
What are some examples of symmetric key encryption algorithms?
DES, 3DES and AES
Example of asymmetric key encryption algorithm?
RSA
which encryption algorithms are modern and which are obsolete?
DES and 3DES are obselete
RSA and AES are modern
why do we need hashing in encryption?
Encryption is usually used for making data unreadable for third party. And of course, this data that is encrypted during transfer over network could be easily changed, compromised or something like that.
And that will lead to situation when receiver will not be able to read original data or will read it with some errors. And that’s where hash comes in.
what is hash?
Hash is a fixed length string.
And its length may be 128 bits or 160 bits or 256 bits or something longer.
And this length depends on the algorithm that is used for creation of the hash.
Does hashing require a key?
hash functions don’t require any key.
So we take only data, take hash, function and create using this hash function special hash.
Explain this diagram about hashing
So what happens here in this diagram, hash function is applied to original data and hash is created.
And after that, data, along with hash are sent over the network to receiver and receiver, receives data and hash separately.
And now receiver takes data applies same hash function as was applied here on this side and creates hash.
And after that this hash and this hash are compared.
And if those hashes match it means for receiver that this data was not changed or was not mutated during transfer over the network.
And that is the purpose of hash.
It verifies integrity of data.
In which order does encryption and hashing happen?
Encryption happens before creation of hash
examples of hashing algorithms?
MD5, SHA, MAC
what is MD5?
MD5 is a hashing algorithm, that creates a fixed length hash of variable length input and output is always 128 bits.
what are sha-1, sha-256 and sha-512?
Those numbers are length of the hash.
sha-1 gives a hash of fixed length 160 bits
sha-256 gives hash of fixed length 256 bits
sha-512 gives has of fixed length 512 bits
How do you create hash using sha algorithm?
what is HMAC ?
HMAC: Data + key = Hash
Is HMAC algorithm used alone or in combination with other hash algorithms?
HMAC algorithm may be used standalone, but usually it is used in combination either with MD5 or SHA algorithms.
How is HMAC different from other hashing algorithms?
HMAC process adds special secret key into hashing process.
And it means that with Mac algorithm we take not just input data, we also take special secret key or password and utilize it during creation of the hash.