CRYPTOGRAPHY DECRYPTED

Cryptographic algorithms perform a variety of essential functions, including for crypto. As the key building block, they are important (and fascinating) to understand. From the Caesar Cipher to ECDSA, here are the basics.

A 🧵

cryptography

is the study of the techniques for securing communication and data in the presence of adversaries.

Together with cryptanalysis (the study of decryption), it forms the larger discipline of cryptology

Various algorithms referred to as ciphers and a secret key transform input data (plaintext) into encrypted output (ciphertext).

Cryptography can be bifurcated into symmetric cryptography, asymmetric cryptography, and hashing functions.

Let's discuss each in turn

SYMMETRIC CRYPTOGRAPHY

uses the same secret key for encryption of the plaintext and decryption of the ciphertext

+: simple, less computation/faster -: requires a way to securely share the secret key btwn sender & receiver; requires a separate secret key for each user pair. Egs:

Monoalphabetic Cipher

the letters of the plaintext are mapped to ciphertext letters based on a single alphabetic key. Caesar Cipher shifts each letter of plaintext a fixed number of positions down the alphabet to create the ciphertext, with the fixed number the secret key

eg. for a secret key of 2, A=C, B=D, C=E

plaintext of "BAT" is encrypted to ciphertext of "DCV"

The recipient knowing the secret key can simply shift each letter back two spots to decrypt

But, this can be decrypted simply by trying all possible shifts

Keyword Cipher

instead of a simple alphabetic shift, insert a keywork at the beginning of the mapped substitution alphabet before continuing on at the end of the keyword & skipping any letters already used. Eg. if keyword is "cipher", substitution alphabet is "CIPHERABDFGJKL..."

plaintext of "BAT" is encrypted to ciphertext of "ICT"

This is more secure than a Caesar Cipher, but is prone to frequency analysis, where a frequently occurring letter in the ciphertext is more likely to map to a common letter like e, t, or a, which can be used to help decrypt

Polyalphabetic Cipher

Rather than use a single, constant alphabetic key, this uses multiple substitution alphabets, varying the mapping of plaintext letters to the substitution alphabet (a letter will map to various letters). The Vigenere Cipher is most well known

ASYMMETRIC CRYPTOGRAPHY

aka public-key cryptography, utilizes mathematically linked public and private keys to eliminate the need to share a secret key

+: No need to share secret key, better for large & expanding networks -: more computationally intensive

Diffie-Hellman

enables 2 unrelated parties to establish a mutual secret over a public communications channel by using large prime numbers and modulo arithmetic. Forms the basis for SSL & TSL, and is often conceptually described using paint

RSA

relies on the fact that every number greater than 1 can be represented uniquely as the product of prime numbers or its unique prime factorization.

It’s easy to multiply large prime numbers together, but v hard to determine that number’s unique prime factorization

Elliptic Curve Digital Signature Algorithm (ECDSA)

a user selects a random private key and runs elliptic curve operations on it to generate a mathematically linked public key that can’t be used to infer the private key that created it. Bitcoin uses the secp256k1 elliptic curve

HASHING FUNCTIONS

transform arbitrary data into a numeric, fixed length string, is that data's digital fingerprint, & is one way, deterministic, easy to compute. Improve efficiency & data verification w/o revealing underlying data. Bitcoin uses SHA-256

SHA-256 hash calculator | Xorbin

CRYPTOGRAPHY & BITCOIN

uses ECDSA to verify transaction authenticity uses SHA-256 to link blocks together by including a hash of the previous block header: time-orders blocks, makes tamper-evident uses SHA-256 in PoW mining puzzle uses SHA-256 in Merkle Trees for data efficiency

To learn more about this fascinating and critical topic, see our report Cryptography Decrypted @GSR_io @MattKunke

Chart of the Week: Cryptography Decrypted - GSR MarketsThis post is based on this twitter thread.

Please login to comment.