Cipher and Cipher Wheel Encoder and Decoder. - Yash-777/Java_Mail GitHub Wiki

Cipher wiki

In cryptography, a cipher (or cypher) is an algorithm for performing encryption or decryption

The operation of a cipher usually depends on a piece of auxiliary information, called a key.

  • Key (cryptography) wiki In cryptography, a key is a piece of information (a parameter) that determines the functional output of a cryptographic algorithm. For encryption algorithms, a key specifies the transformation of plaintext into ciphertext, and vice versa for decryption algorithms. Keys also specify transformations in other cryptographic algorithms, such as digital signature schemes and message authentication codes.

    The encrypting procedure is varied depending on the key, which changes the detailed operation of the algorithm. A key must be selected before using a cipher to encrypt a message. Without knowledge of the key, it should be extremely difficult, if not impossible, to decrypt the resulting ciphertext into readable plaintext.

In cryptography, key size or key length is the number of bits in a key used by a cryptographic algorithm. Key Size, i.e., the size of key used to encrypt a message. As the key size increases, so does the complexity of exhaustive search to the point where it becomes impractical to crack encryption directly.


There are a variety of different types of encryption. Algorithms used earlier in the history of cryptography are substantially different from modern methods, and modern ciphers can be classified according to how they operate and whether they use one or two keys.

Historical - (Cipher Wheel)

Historical pen and paper ciphers used in the past are sometimes known as classical ciphers.
Simple ciphers were replaced by polyalphabetic substitution ciphers (such as the Vigenère) which changed the substitution alphabet for every letter. In cryptography, Caesar's cipher/code or Caesar shift, is one of the simplest and most widely known encryption techniques.

Caesar cipher wiki Mexican Army Cipher Wheel Fialka cipher wiki

Modern

Modern encryption methods can be divided by two criteria: by type of key used, and by type of input data.

By type of key used ciphers are divided into:

  • Symmetric key algorithms (Private-key cryptography), where the same key is used for encryption and decryption.
  • Asymmetric key algorithms (Public-key cryptography), where two different keys are used for encryption and decryption.
int maxKeySize_AES = javax.crypto.Cipher.getMaxAllowedKeyLength("AES");
System.out.println("Symmetric key algorithm (e.g., DES and AES) : "+maxKeySize_AES);

int maxKeySize_RSA = javax.crypto.Cipher.getMaxAllowedKeyLength("RSA");
System.out.println("Asymmetric key algorithm (e.g., RSA) : "+maxKeySize_RSA);

In a symmetric key algorithm (e.g., DES and AES), the sender and receiver must have a shared key set up in advance and kept secret from all other parties; the sender uses this key for encryption(of plaintext), and the receiver uses the same key for decryption(of ciphertext).
This requirement that both parties have access to the secret key is one of the main drawbacks of symmetric key encryption, in comparison to public-key encryption (also known as asymmetric key encryption)

In an asymmetric key algorithm (e.g., RSA), there are two separate keys: a public key is published and enables any sender to perform encryption, while a private key is kept secret by the receiver and enables only him to perform correct decryption.

Asymmetric cryptography is a branch of cryptography where a secret key can be divided into two parts, a public key and a private key. The public key can be given to anyone, trusted or not, while the private key must be kept secret (just like the key in symmetric cryptography).

Key Pairs (RSA)

Two of the best-known uses of public key cryptography are:

  • Public key encryption, in which a message is encrypted with a recipient's public key. The message cannot be decrypted by anyone who does not possess the matching private key, who is thus presumed to be the owner of that key and the person associated with the public key. This is used in an attempt to ensure confidentiality.
  • Digital signatures, in which a message is signed with the sender's private key and can be verified by anyone who has access to the sender's public key. This verification proves that the sender had access to the private key, and therefore is likely to be the person associated with the public key. This also ensures that the message has not been tampered with, as a signature is mathematically bound to the message it originally was made with, and verification will fail for practically any other message, no matter how similar to the original message.

Key exchange: Message Signature And Verification for Prof of Identity Public key infrastructure

Asymmetric cryptography has two primary use cases: authentication and confidentiality. Using asymmetric cryptography, messages can be signed with a private key, and then anyone with the public key is able to verify that the message was created by someone possessing the corresponding private key. This can be combined with a proof of identity system to know what entity (person or group) actually owns that private key, providing authentication.

Encryption of Data

Encryption with asymmetric cryptography works in a slightly different way from symmetric encryption. Someone with the public key is able to encrypt a message, providing confidentiality, and then only the person in possession of the private key is able to decrypt it.

secretMsg private_bytes(openMsg, private_key, encryption_algorithm) // CMSAlgorithm.AES128_CBC
openMsg public_bytes(secretMsg, public_key)
Digital signatures, but not encrypted Prof of Identity RSA is a public-key algorithm for encrypting and signing messages. Diffie-Hellman key exchange (D–H) is a method that allows two parties to jointly agree on a, shared secret using an insecure channel.
⚠️ **GitHub.com Fallback** ⚠️