NSC Notes
NSC Notes
Unit – 1 Notes
What are Plaintext and Ciphertext? How do they interact?
Plaintext can refer to anything which humans can understand and/or relate to. This may be as
simple as English sentences, a script, or Java code. If you can make sense of what is written,
then it is in plaintext.
Ciphertext, or encrypted text, is a series of randomized letters and numbers which humans
cannot make any sense of. An encryption algorithm takes in a plaintext message, runs the
algorithm on the plaintext, and produces a ciphertext. The ciphertext can be reversed through
the process of decryption, to produce the original plaintext.
Example: We will encrypt a sentence using Caesar Cipher. The key is 7, which means the
letter a becomes h.
Plaintext: This is a plaintext.
Ciphertext: Aopz pz h wshpualea.
What is plaintext?
In cryptography, plaintext is usually ordinary readable text before it is encrypted into
ciphertext, or readable text after it is decrypted.
Data input to or output from encryption algorithms is not always plaintext. For example,
when data is superencrypted, or encrypted more than once using different encryption
algorithms, only the input to the first encryption method is considered plaintext.
Binary files are not usually considered plaintext, because they are not human-readable -- but
they are still accessible to end users. Examples of non-plaintext binary files include the
following:
• executable program files;
• rich media files, including images, video and audio recordings; and
• data files generated by applications like spreadsheets, databases and word processors,
which may be partially or completely stored as binary data.
In Request for Comment (RFC) 4949, "Internet Security Glossary, Version 2," the Internet
Engineering Task Force differentiates between plaintext and cleartext, noting that the two
terms are not interchangeable. For the purpose of internet security, cleartext data is not
encrypted, while plaintext data could be encrypted if it is being superencrypted.
According to the National Institute of Standards and Technology (NIST), plaintext refers to
"intelligible data that has meaning and can be understood without the application of
decryption," although this is one of several definitions NIST recognizes -- including the IETF
definition.
This table shows the differences between the three types of cryptography text -- plaintext,
cleartext and ciphertext.
Other examples where using a protocol or application that does not encrypt user ID and
password exposes credentials include the following:
• Sharing secret keys or private keys in email clients presents a common situation when
using encryption and decryption. Protocols and applications using shared secrets for
authentication should always be designed and configured to encrypt shared keys -- and early
internet protocols like were not always designed to do so. For example, the Internet Mail
Access Protocol (IMAP) is an email client protocol for retrieving and managing email
messages. IMAP originated in the 1980s, and legacy deployments did not always require
encryption for credentials.
Cyber attacks commonly target resources stored in plaintext. Many attacks succeed by
uncovering plaintext files that contain passwords or other sensitive information in plaintext
rather than encrypted.
Often, plaintext is preferred for the content in question. For example, plaintext emails are
messages that contain only text. Promotional email campaigns often use plaintext messages
to avoid strict spam-filtering systems that tend to block messages that are HyperText Markup
Language-encoded or that add other binary components.
For instance, if a letter A in the plaintext is changed to G then each appearance of A in the
plaintext will be restored by G.
Plaintext : hello
Ciphertext : IFMMP
This is a monoalphabetic cipher as both 1’s are encrypted as ‘M’.
The relationship among a character in plaintext and a character in ciphertext is one to many.
For instance, letter ‘A’ can be restored by the letter ‘C’ and the similar letter ‘A’ can be
restored by ‘N’ later in the ciphertext.
In polyalphabetic cipher, frequencies of plaintext letter are not reflected in the ciphertext.
Therefore, breaking of polyalphabetic cipher is complex than monoalphabetic cipher as
statistical analysis cannot be used on it.
The main feature of polyalphabetic substitution cipher are the following −
One-Time Pad − The one-time pad cipher recommend that the key length must be as long as
the plain text to avoid the repetition of key. Along with that, the key must be used only once
to encrypt and decrypt the individual message after that the key must be discarded.
Caesar Cipher − In this substitution technique, it can encrypt the plain text, each alphabet of
the plain text is restored by the alphabet three places further it and it can decrypt the cipher
text each alphabet of cipher text is restored by the alphabet three places before it.
Playfair Cipher − The playfair cipher is also known as Playfair Square. It is a cryptographic
technique used for manual encryption of information. This scheme was developed by Charles
Wheatstone in 1854.
The Playfair cipher was used by the British army in World War I and by the Australian in
World War II. This was applicable because the playfair cipher is perfectly fast to use and
does not demand some specific equipment to be used.
The substitution technique differs from the transposition technique in that the substitution
technique replaces the plaintext characters for other characters, numbers, and symbols. In
contrast, the Transposition techniques don't change the character but rather shift the symbol's
position.
In this article, you will learn about the difference between substitution and transposition
techniques. But before discussing the differences, you must know about substitution and
transposition techniques with their features.
Let's take an easy example to understand this technique. The plaintext "JUMP" will be turned
into "MXPS" using Caesar Cipher. Following the Caesar cipher, various substitution
techniques were developed, including the Mono-alphabetic cipher, Polyalphabetic
substitution cipher, Polygram substitution cipher, Playfair cipher, Homophobic substitution
cipher, and Hill cipher.
The Caesar cipher was the weakest technique, but as the techniques evolved from time to
time, the new version became stronger. The substitution technique's weakness is that it is
highly predictable, and if the translation table is known, the substitution may be disrupted.
In the substitution cipher technique, the letters in plain text are substituted by other letters,
numbers, or symbols. A character's identity is changed, but its place remains constant in the
substitution technique. Some algorithms that use the substitution technique are
monoalphabetic substitution cipher, Playfair cipher, and polyalphabetic substitution cipher.
The substitution cipher approach allows for the detection of plain text by low-frequency
letters. Caesar Cipher is an example of the substitution cipher technique.
Rail Fence encryption is a sort of transposition cipher that acquires its name from how it is
encrypted the data. The plaintext is written down and diagonally on successive "rail" of an
artificial fence in the rail fence and then pushed up when you get to the bottom. After that, the
message is read aloud in a row-by-row fashion.
The Rail Fence Cipher is based on an old Greek mechanical device for building a
transposition cipher that follows a fairytale-like pattern. The mechanism consisted of a
cylinder with a ribbon wrapped around it. The encrypted message was written on the coiled
ribbon. The characters of the original message were rearranged when the ribbon was uncoiled
from the cylinder. The message was decrypted when the ribbon was wrapped in a cylinder
with a similar diameter to the encrypting cylinder.
The keys that are closer to the proper key in the transposition cipher technique can reveal
plain text. The transposition cipher approach does not exchange one sign for another but
rather moves the symbol. The two most common types of transposition cipher are keyless and
keyed transpositional cipher. The Reil Fence Cipher is an excellent instance of a transposition
tehnique. The position of the character is modified in the transposition cipher technique, but
the character's identity remains unchanged.
The substitution approach employs a substitute for the plaintext characters to transform them
into ciphertext. In contrast, the transposition technique essentially rearranges the plaintext
characters. The substitution technique aims to change the entity's identification. In contrast,
the transposition technique affects the entity's position instead of its identity.
The substitution technique replaces every character with an integer, character, and symbol. In
contrast, in the transposition technique, every character has been positioned from its actual
position. Some algorithms that use the substitution technique are monoalphabetic,
polyalphabetic substitution cipher, and Playfair cipher. In contrast, the transposition
techniques utilize the keyed and keyless transpositional ciphers.
The plaintext in the substitution strategy could be easily determined using the low-frequency
letter. In contrast, in the transposition technique, the keys close to the right key lead to the
plaintext discovery.
Substitution cipher and Transposition cipher are both classical techniques in cryptography,
but these techniques are now outdated. Transposition ciphers shift each character of a string
to another position. In contrast, the substitution ciphers replace every character in a string
with a different number, character or symbol.
Difference between Encryption and Decryption
What is Cryptography?
Cryptography is used to secure and protect data during communication. It is helpful to
prevent unauthorized person or group of users from accessing any confidential data.
Encryption and decryption are the two essential functionalities of cryptography.
A message sent over the network is transformed into an unrecognizable encrypted message
known as data encryption. At the receiving end, the received message is converted to its
original form known as decryption.
Data is encrypted to make it safe from stealing. However, many known companies also
encrypt data to keep their trade secret from their competitors.
KEY DIFFERENCE
Encryption is a process of converting normal data into an unreadable form whereas
Decryption is a method of converting the unreadable/coded data into its original form.
Encryption is done by the person who is sending the data to the destination, but the
decryption is done at the person who is receiving the data.
The same algorithm with the same key is used for both the encryption-decryption processes.
Helps you to protect your confidential data such as passwords and login id
Provides confidentiality of private information
Helps you to ensure that that the document or file has not been altered
Encryption process also prevents plagiarism and protects IP
Helpful for network communication (like the internet) and where a hacker can easily
access unencrypted data.
It is an essential method as it helps you to securely protect data that you don’t want
anyone else to have access.
Types of Keys
Symmetric Key:
Symmetric-key encryption are algorithms which use the same cryptographic keys for both
encryption of plaintext and decryption of ciphertext.
Asymmetric Key:
Asymmetric encryption uses 2 pairs of key for encryption. Public key is available to anyone
while the secret key is only made available to the receiver of the message. This boots
security.
Public Key:
Public key cryptography is an encryption system which is based on two pairs of keys. Public
keys are used to encrypt messages for a receiver.
Private Key:
Private key may be part of a public/ private asymmetric key pair. It can be used in
asymmetric encryption as you can use the same key to encrypt and decrypt data.
Pre-Shared Key:
In cryptography, a pre-shared key (PSK) is a shared secret which was earlier shared between
the two parties using a secure channel before it is used.
Location of The person who is sending the data The receiver receives the data and
Conversion to the destination. converts it.
Parameter Encryption Decryption
Summary
Asymmetric Key Encryption: Asymmetric Key Encryption is based on public and private
key encryption techniques. It uses two different key to encrypt and decrypt the message. It is
more secure than the symmetric key encryption technique but is much slower.
The size of cipher text is the same or smaller The size of cipher text is the same or larger
than the original plain text. than the original plain text.
The length of key used is 128 or 256 bits The length of key used is 2048 or higher