A cipher is an algorithm that encrypt a plain text message into a ciphertext.
Cipher algorithm can be categorized by the key that they used as parameters.
Cipher | Symmetry | Key | Encryption / Decryption | Data Integrity | Authenticity | Secrecy |
---|---|---|---|---|---|---|
Advanced Encryption Standard (AES) | symmetric | Shared Key | Two-way | Yes | Yes | Yes |
RSA (Rivest–Shamir–Adleman) | asymmetric | Key Pair | Two-way | Yes | Yes | Yes |
Hash algorithms (Md5, sha1-N) | Na | No key | One-way | Yes | No | No |
Base64 (bit to characters) | Na | No key | Two-way | No | No | No |
Mac | Na | Shared key | Na | Yes | Yes | No |
A commutative cipher is one in which the order of encryption and decryption is interchangeable, just as the order of multiplication is interchangeable (i.e., A*B*C = A*C*B = C*B*A).
Often a cryptosystem will use both type of algorithms. For example, a symmetric key to exchange keys and an asymmetric cipher to encrypt the messages.
Encryption algorithms which use the same and single key for both encryption and decryption are known as:
See Symmetric Cipher
Asymmetric key algorithms (also known as public key cryptographic algorithms) was invented in the 1970s.
They used two keys (one public and one private. It is asymmetric because you need the other key pair to decrypt.
They use a pair of keys —or keypair— a public key and a private one.
The critical advantage in an asymmetric key system is that Bob and Alice never need to:
In addition, if Bob were careless and allowed someone else to copy his key, Alice's messages to Bob would be compromised, but Alice's messages to other people would remain secret, since the other people would be providing different padlocks for Alice to use.
When a message is encrypted with:
In this scheme, secret messages can be exchanged with no prior secret agreement, each person using:
In a secure asymmetric key encryption scheme, the private key should not be deducible from the public key. The design is such that finding out the private key is extremely difficult, even if the corresponding public key is known.
Because of the computational complexity of asymmetric encryption, it is usually used to exchange an on-the-fly symmetric_key (e.g. a session key), which will only be used for the current session. This symmetric key is then used to encrypt the rest of the potentially long message sequence. The symmetric encryption/decryption is based on simpler algorithms and is much faster.
The Three-pass protocol 1) requires neither party to even touch the other party's padlock (or key to get access);
Bob and Alice have separate padlocks.
This scheme is only possible with commutative cipher.
During the SSL negotiation between client and server, the server and client will indicate to each other a list of algorithms that can be understood ranked by order of preference. The common preferred algorithm is then chosen.
To know more about cipher, you can refer to this specifications: