Cryptography
Keywords
Ciphertext - Represent the plaintext encrypted
Cipher - A method of encrypting or decrypting data. Modern ciphers are cryptographic, but there are many non cryptographic ciphers like Caesar.
Plaintext - It’s a text or file not encrypted
Encryption - Processing for encrypting data into ciphertext, using a cipher.
Encoding - NOT a form of encryption, just a form of data representation like base64. Immediately reversible.
Key - Information for encrypting and decoding the encrypted data
Passphrase - Separate to the key, a passphrase is similar to a password and used to protect a key.
Asymmetric encryption - Uses different keys to encrypt and decrypt.
Symmetric encryption - Uses the same key to encrypt and decrypt
Standards PCI-DSS specify how your data need to be encrypted in the storage (in rest) and while they are being transmitted.
https://listings.pcisecuritystandards.org/documents/PCI_DSS_for_Large_Organizations_v1.pdf
Types of encryption
Symmetric encryption, we have one key for encrypting and decrypting. DES (Data Encryption Standard), not used, 3DES or AES (Advanced Encryption Standard) are algorithms of symmetric encryption.
Asymmetric encryption, it’s a pair of keys. One to encrypt (private key) and the other one to decrypt (public key). RSA or Elliptic Curve Cryptography
RSA
RSA is an asymmetric key
SSH
It’s possible to crack the password with john:
python3 ssh2john.py ~/idrsa.id_rsa > ~/idrsa_cracked
./john --wordlist ../../rockyou.txt ~/idrsa_cracked
Diffie-Hellman
When two people which to communicate securely in the public channel, they need to exchange their key and to have an common key. For doing that, we use the Diffie-Hellman:
https://ee.stanford.edu/~hellman/publications/24.pdf
https://www.youtube.com/watch?v=NmM9HA2MQGI
AES
AES for Advanced Encryption Standard, is the replacement of the DES encryption.
https://www.youtube.com/watch?v=O4xNJsjtN6E
Quantum
https://nvlpubs.nist.gov/nistpubs/ir/2016/NIST.IR.8105.pdf
Perf generate key for ECP and Key
https://www.matec-conferences.org/articles/matecconf/pdf/2018/77/matecconf_iciee2018_03001.pdf
https://wiki.openssl.org/index.php/Command_Line_Elliptic_Curve_Operations
https://wiki.openssl.org/index.php/Elliptic_Curve_Diffie_Hellman
https://cryptobook.nakov.com/asymmetric-key-ciphers/ecdh-key-exchange-examples
https://andrea.corbellini.name/2015/05/30/elliptic-curve-cryptography-ecdh-and-ecdsa/