You are on page 1of 3

1.

When a string is XORed with zero, the output will be the same string as the input string.
This is because XORing any value with zero results in the original value. The reason for this is
that the XOR operation compares the bits of two values, and if the corresponding bits are
different, it sets the output bit to 1. However, if one of the bits is 0, then the output bit will always
be the same as the other input bit. Therefore, if one input is zero, the output will always be the
same as the other input
For example, if we have a string "Hello, world!" and we XOR it with zero, the output will be the
same as the input: "Hello, world!".
In summary, XORing a string with zero does not change the string at all.

2.
XORing a string with 127 will flip the seventh bit of each character in the string. This is because
127 in binary is 01111111, and XORing any value with this binary pattern will invert the seventh
bit.

To perform this operation, we can convert each character in the string to its ASCII code, XOR it
with 127, and then convert the resulting code back to a character.

3a .

Caesar Cipher Program in Java

It is one of the simplest and most used encryption techniques. In this technique, each
letter of the given text is replaced by a letter of some fixed number of positions down the
alphabet.For example, with a shift of 1, X would be replaced by Y, Y would become Z,
and so on. Julius Caesar was the first one who used it for communicating with his
officials. Based on his name, this technique was named as Caesar Cipher technique.An
integer value is required to cipher a given text. The integer value is known as shift,
which indicates the number of positions each letter of the text has been moved down.

3b.

A substitution cipher takes each character (sometimes groups of characters) in a


message and replaces it with a different character according to fixed rules. Every
occurrence of one character will be substituted with the same replacement character.An
encrypted message can then be decrypted with another substitution cipher, this time set
to substitute each character with the one that it originally replaced.

3c.

Hill cipher is a polygraphic substitution cipher based on linear algebra.Each letter is


represented by a number modulo 26. Often the simple scheme A = 0, B = 1, …, Z = 25
is used, but this is not an essential feature of the cipher. To encrypt a message, each
block of n letters (considered as an n-component vector) is multiplied by an invertible n
× n matrix, against modulus 26. To decrypt the message, each block is multiplied by the
inverse of the matrix used for encryption.

4.

Data encryption standard (DES) has been found vulnerable to very powerful


attacks and therefore, the popularity of DES has been found slightly on the
decline. DES is a block cipher and encrypts data in blocks of size of 64
bits each, which means 64 bits of plain text go as the input to DES, which
produces 64 bits of ciphertext. The same algorithm and key are used for
encryption and decryption, with minor differences. The key length is 56 bits. 

5.

Blowfish is also an encryption technique which is replacement to DES algorithm and


that is very powerful ammunition against hackers and cyber-criminals. It is utilized in a
wide array of products like in performance-constrained environments such as
embedded systems, secure E-mail encryption tools, backup software, password
management tools. Ø It is a symmetric key encryption algorithm in which the same
secret key is used for both encryption and decryption i.e. same secret key is used by
sender and receiver and it is kept secret. Ø It is block cipher algorithm i.e. The message
is divided into fixed length blocks (64-bits) during encryption and decryption. The key
size ranges from 32 to 448 bits(variable length key is used) Ø It is compact i.e. executes
in less memory and simple (XOR, addition etc operations are performed here)
algorithm.It is a 16-rond feistel cipher and uses large key-dependent substitution
boxes(s-box).

6.

Rijndael is advanced version of AES(which is defined for fixed block size i.e.128 bit)
which defined for variable length block sizes i.e.128,192 and 256 bits Ø If a different
block size between encryption and decryption is used, then it is not possible to recover
the original plaintext. Ø The Rijndael algorithm is a new generation symmetric
encryption algorithm. Ø It is block cipher algorithm data handling happened in 128-bits
blocks,variable key length & variable round number. Ø Encryption under Rijndael is
achieved through a series of matrix transformations . Each transformation is known as a
round Ø Rijndael does not use a fixed number of rounds, the number of rounds are
dependant on key/block sizes, as follows: · For key/block size 128 bits , 9 rounds are
required. · For key/block size 192 bits, 11 rounds are required. · For key/block size 256
bits, 13 rounds are required.

You might also like