Secrecy / Confidentiality / Encryption / Cryptography

Conversion of Data/Plain-text into unreadable/cipher text.

Types of Encryption

Symmetric / Secret Key / 1 key Assymetric /2 key / Public,Pvt Key pair (DH, RSA)
What Only 1 key is shared between sender & receiver

            \/  Key-1                       \/ Key-1
Data > | Encryptor | > cipher Text  > | Decryptor | > Data
          
Public key(encrypt), Private key(decrypt). Data encrypted with Public can only be decrypted using Pvt key.
Both are mathematically linked. Public Key are published on website publicly.

Alice create [Pub_A, Pvt_A] and kept public key on http://alice.com

                         Bob  <--read Alice public key-- http://alice.com
                        Pub_A
                         \/
message(plain text) > |Encrypt| > XXX

                                                                 Alice
                                                              own Pvt_A
                                                                  \/
                                     ---sent to Alice---> XXX >|Decrypt| > message
            
Algorithms DES(Broken in 1999), 3-DES(Broken), AES(Key sizes: 128, 192, 256, 384), RC4 RSA (Ronald Rivest, Adi Shamir, Len Adleman), Diffe-Helman, Crammer-shoup, El-Gamal
Speed Faster(Since encryption process is less complicated) Slow. Big Calculations are required to Generate a public-Pvt Key Pair
Key Size AES-128, 192, 256 RSA:1024,2048 This is not Key, but sizes of prime number which is used to derive the Pvt key.
Check DH Algo
Usage To exchange keys for symmetric algorithms, once the keys are established symmetric key algorithms used to encrypt data

How safe is 128, 256 bit Keys

The longer the key, higher work to be done by breaking algo.
- Email: 64-bit keys will do
- Commercial applications: 128 bits
- Govt org: 256 bits

Number of Unique keys:


- 2   No of unique keys: 2pow2 = 4
- 3   No of unique keys: 23 = 8
- 32  No of unique keys: 232 = 4,294,967,296    (4 billion)
- 64  No of unique keys: 264  = 18 x 1018 keys (18 Quintillion)
- 128 No of unique keys: 2128 = 34 x 1036 keys (18 x 1018 Quintillion)
- 256 No of unique keys: 2256 =

How Long Hacker(having super Computer) need to crack key?
  1 super computer can perform 1017 FLOPS (a hundred quadrillion FLOPS floating point operations per second)
  Per Year = 3600(hour) x 24 x 30 x 12 = 31,104,000 x 1017 = 31,104,00 Quintillion Operations.
  340,282,366,920,938,463,463 / 31,104,000 = 109,401,481,134,561 (approx) = 109 Trillion
  109 Trillion super computers working parallelly for 1 year can produce all combinations of 128 bit key