0.0.4 • Published 7 years ago
my-easy-crypto v0.0.4
easy-crypto
easy come, easy go
I find a answer of "what are differences between Cipher and Hash"
the answer is :
A hash is used to take a message of any length and produces a fixed-sized output length using a hash function.
For example the SHA256 hash function produces a 256-bit hash value regardless of the input message length. Given a hash value it is not possible in general to determine the original message because many different messages could generate the same hash value. A hash function destroys information in the general case.
A cipher, on the other hand, takes a message of any length and produces an output of equal or greater length. It does not destroy information.
A cipher output (called a ciphertext) can be decoded to produce the original message.