Cryptography
Cryptography is the practice and study of techniques for securing communication
and information through the use of mathematical algorithms. The word
"cryptography" comes from the Greek words kryptos (meaning "hidden") and grapho
(meaning "writing"). Essentially, cryptography involves creating written or digital
codes to protect information from unauthorized access or tampering.
Cryptographic components
Plaintext: This is the original intelligible message or data that is fed into the
algorithm as input.
• Encryption algorithm: The encryption algorithm performs various substitutions
and transformations on the plaintext.
• Secret key: The secret key is also input to the encryption algorithm. The key is a
value independent of the plaintext and of the algorithm. The algorithm will produce a
different output depending on the specific key being used at the time. The exact
substitutions and transformations performed by the algorithm depend on the key.
• Ciphertext: This is the scrambled message produced as output. It depends on the
plaintext and the secret key. For a given message, two different keys will produce two
different ciphertexts. The ciphertext is an apparently random stream of data and, as it
stands, is unintelligible.
• Decryption algorithm: This is essentially the encryption algorithm run in reverse. It
takes the ciphertext and the secret key and produces the original plaintext.
Properties of secure communication/ Goals of Cryptography:
Confidentiality:
Definition: Ensures that only authorized parties can access the data or message.
Unauthorized users or adversaries cannot read or intercept the communication.
Techniques: Encryption algorithms (e.g., AES, RSA) are commonly used to protect
data from eavesdropping.
• Integrity:
Definition: Guarantees that the data has not been altered or tampered with, either in
transit or at rest.
Techniques: Cryptographic hash functions (e.g., SHA-256) and message
authentication codes (MACs) are used to ensure that data remains intact.
.
• Availability: Ensuring timely and reliable access to and use of information. A loss
of availability is disrupting access to or use of information or an information system.:
• Authenticity:
Definition: Verifies the identity of the sender or the source of a message, ensuring that
it came from the legitimate party.
Techniques: Digital signatures, public-key cryptography, and certificates are
commonly used for authenticating users or devices.
• Accountability:
Definition: Prevents the sender from denying the authenticity of a message or
transaction. It ensures that the sender cannot claim they didn’t send the message.
Techniques: Digital signatures, audit logs, and time-stamping services help provide
proof of origin and transaction history.
.
Types and difference of Cryptography:
Cryptography can be broadly classified into several types based on the methods used
to secure data. The two primary types are symmetric-key cryptography and
asymmetric-key cryptography, along with other specialized techniques like hashing
and digital signatures.
1. Symmetric-Key Cryptography (Secret Key Cryptography)
In symmetric-key cryptography, the same key is used for both encryption and
decryption. This means that both the sender and the recipient must share the secret
key before communication can take place. Symmetric-key cryptography is fast and
efficient, making it ideal for encrypting large amounts of data.
● Examples of Symmetric Algorithms:
o AES (Advanced Encryption Standard)
o DES (Data Encryption Standard)
o RC4
o 3DES (Triple DES)
Advantages:
● Faster and more efficient, especially for encrypting large amounts of data.
● Suitable for bulk data encryption.
Disadvantages:
● Key distribution is a challenge, as the key must be securely shared between the
parties involved.
● If the key is intercepted, the communication is compromised.
2. Asymmetric-Key Cryptography (Public Key Cryptography)
In asymmetric cryptography, there are two keys: a public key and a private key.
The public key is used to encrypt the message, and the private key is used to decrypt
it. The public key can be freely shared with anyone, while the private key must remain
secret. This method allows secure communication between parties who have never
shared a key in advance.
● Examples of Asymmetric Algorithms:
o RSA (Rivest-Shamir-Adleman)
o ECC (Elliptic Curve Cryptography)
o DSA (Digital Signature Algorithm)
Advantages:
● Solves the problem of key distribution because only the public key is shared.
● Provides mechanisms for digital signatures, allowing for authentication and
non-repudiation.
Disadvantages:
● Slower than symmetric-key encryption, which makes it less efficient for
encrypting large volumes of data.
● Requires more computational resources.
Symmetric Key Asymmetric Key
It requires two keys, a public key and a
It only requires a single key for both
private key, one to encrypt and the
encryption and decryption.
other to decrypt.
The size of ciphertext is the same or The size of ciphertext is the same or
smaller than the original plaintext. larger than the original plaintext.
The encryption process is very fast. The encryption process is slow.
It is used when a large amount of data It is used to transfer small amount of
needs to be transferred. data.
It provides confidentiality, authenticity,
It only provides confidentiality.
and non-repudiation.
The length of key used is 2048 or
The length of key used is 128 or 256 bits
higher
In symmetric key encryption, resource
In asymmetric key encryption, resource
utilization is low compared to
utilization is high.
asymmetric key encryption.
It is efficient as it is used for handling It is comparatively less efficient as it
large amount of data. can handle a small amount of data.
Symmetric Key Asymmetric Key
Security is lower as only one key is used Security is higher as two keys are used,
for both encryption and decryption one for encryption and the other for
purposes. decryption.
Examples: Diffie-Hellman, ECC,
Examples: 3DES, AES, DES and RC4
El Gamal, DSA and RSA