FCoDS - W5 - One-Way Hash Function
FCoDS - W5 - One-Way Hash Function
of Data Security
W5 - One-Way Hash Function
…
The MD (Message Digest) series
Merkle-Damgard construction
What distinguish the MD5, SHA- I, and SHA-2 hash functions are
their different compression functions, block sizes, and hash sizes.
One-Way Hash Commands
seed@VM:~/.../Lab2$ md5sum plaintext
6165796b89ff6ddeb242beafcf567dcf plaintext
seed@VM:~/.../Lab2$ sha256sum plaintext
b6ca1009cc6c8d7bfed77672fee88de5d9a9bde49faef5369249d2aa72f81b60
plaintext
seed@VM:~/.../Lab2$ echo -n "6165796b89ff6ddeb242beafcf567dcf" | wc
0 1 32
seed@VM:~/.../Lab2$ echo -n
"b6ca1009cc6c8d7bfed77672fee88de5d9a9bde49faef5369249d2aa72f81b60" |
wc
0 1 64
seed@VM:~/.../Lab2$ echo "64 * 4" | bc
256
seed@VM:~/.../Lab2$ openssl dgst --list
Supported digests:
-blake2b512 -blake2s256 -md4
-md5 -md5-sha1 -mdc2
-ripemd -ripemd160 -rmd160
-sha1 -sha224 -sha256
-sha3-224 -sha3-256 -sha3-384
-sha3-512 -sha384 -sha512
-sha512-224 -sha512-256 -shake128
-shake256 -sm3 -ssl3-md5
-ssl3-sha1 -whirlpool
seed@VM:~/.../Lab2$ openssl dgst -sha256 plaintext
SHA256(plaintext)= b6ca1009cc6c8d7bfed77672fee88de5d9a9bde49faef5369249d2aa72f81b60
seed@VM:~/.../Lab2$ sha256sum plaintext
b6ca1009cc6c8d7bfed77672fee88de5d9a9bde49faef5369249d2aa72f81b60 plaintext
seed@VM:~/.../Lab2$ openssl sha256 plaintext
SHA256(plaintext)= b6ca1009cc6c8d7bfed77672fee88de5d9a9bde49faef5369249d2aa72f81b60
seed@VM:~/.../Lab2$ python
Python 2.7.18 (default, Mar 8 2021, 13:02:45)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import crypt
>>> print(crypt.crypt('dees', '$6$n8DimvsbIgU0OxbD$'))
$6$n8DimvsbIgU0OxbD$YZ0h1EAS4bGKeUIMQvRhhYFvkrmMQZdr/hB.Ofe3KFZQTgFTcRgoIoKZ
dO0rhDRxxaITL4b/scpdbTfk/nwFd0
Trusted Timestamping
MAC(K, M) = H(K || M)
seed@VM:~/.../Lab2$ echo -n "My public speech" | openssl dgst -sha256 -hmac "secretkey"
(stdin)= 22d2d3563b66881361e69460d7400d5603f943262b4c072fa5f12af7a8c8efd6
seed@VM:~/.../Lab2$ echo -n "My public speech" | openssl dgst -sha256 -hmac "secret"
(stdin)= 0f52839c33df5ea643d2d574d90f618537373637539789cbb9089858ee744137
Blockchain
and Bitcoins
Blockchain
● Blockchain was conceptualized in 2008 by an anonymous
person or group known as Satoshi Nakamoto
● It was implemented in 2009 as a core component of Bitcoin
● A blockchain is a continuously growing list of records, called
blocks, which are linked and secured using cryptography
● A blockchain is typically managed by ledgers in a peer-to-peer
network, not by any central party.
● Once a block is linked and accepted, it is extremely difficult to
modify any record inside the block, because that requires
alteration of all subsequent blocks on the majority of the
ledgers on the peer-to-peer network, i.e., it requires collusion
of the network majority.
● Due to these properties, blockchains are being used in many
applications. Bitcoin is probably the most successful
application of blockchains.
Hash Chain and Blockchain