Kryptolesson #21

The guardian of the blockchain

The term cryptography stems from the ancient greek “kryptós graphein”, hidden secret, and refers to a broad variety of practices and studies of techniques for securing communication and data in the presence of adversaries. In the context of cryptography, adversaries are malicious entities who strive to hinder users of the cryptosystem from achieving goals of privacy, integrity and data availability. Hence, cryptography denotes the construction and analyzation of protocols preventing a third party from accessing private messages or transactions during a communication process. This implies techniques for encryption and decryption of information are to be solely accessible for designated subjects.

To understand how cryptography works to secure data transferred on a Blockchain, one must grasp key concepts of modern computer-based cryptography: Here, encryption means a process where a readable message (plaintext) is converted into a non-readable format (ciphertext) by means of a cryptographic algorithm. Decryption refers to the inverse process, thus converting ciphertext into plaintext. In order to induce the output of the cryptographic algorithm, i.e. to encrypt or to decrypt a message, a key – representing a small amount of information - is needed. Blockchain uses so-called asymmetric key cryptography where dissimilar keys for encryption (public key) and for decryption (private key) are used, respectively.

Hash functions are mathematical algorithms which generate a hash value of a fixed length from the plaintext. Without the key, the discovery of the plain text is practically impossible. By using cryptographic hash functions in blockchains, avalanche effects are generated (i.e. a slight change in the data results into a significant different output, what implies that any alteration in the block data will lead to inconsistency and break the blockchain, thus making it invalid). In addition, hashes used in blockchain are unique and deterministic, by what any input will always have the same output if passed to the same hash function. Ultimately, the impossibility of reverse engineering might be the biggest advantage of cryptographic hash functions in Blockchains.

Digital signatures are a central computer-based cryptographic used in blockchain technology. When sending a message (e.g., a transaction of cryptocurrency on Blockchain), a unique signature number is created from the hash of the message by using the signer ́s private key. This signature number can then be used together with the public key to verify the sender ́s integrity. The public key serves as the “address” of the sender, whereas the private key is used to access that address data & to authorize any of the actions for the address. Digital signatures are used to approve transactions of cryptocurrencies.

Together, the three elements of public-private keys, hashing and digital signatures constitute the foundation of Blockchain technology. These cryptographic features make it possible for blocks to get securely linked to other blocks, thereby ensure liability and immutability of the privacy and consensus.

Photo by Zachary XU