cipher........!

cipher........!

lets start with understanding what's ciphers?

I know it might too basic for you! But its fun

We can call it Alfred(Batman's butler) of privacy. Its building blocks of privacy just like Alfred is the reason for batman's strength (not Ra's al Ghul) .

Cipher are encryption algorithm which basically converts a message (plaintext) to ciphertext using a key .

there are symmetric and asymmetric ciphers! When a cipher uses the same key for encryption and decryption, they are known as symmetric key algorithms or ciphers. Asymmetric key algorithms or ciphers use a different key for encryption/decryption.

Block ciphers accumulate symbols in a message of a fixed size (the block), and stream ciphers work on a continuous stream of symbols. In stream cipher, one byte is encrypted at a time while in block cipher ~128 bits are encrypted at a time.

STREAM CIPHER

One of the benefits of following stream cipher is to make crypt analysis more difficult, so the number of bits chosen in the Keystream must be long in order to make crypt analysis more difficult. A key will be provided as input to pseudorandom bit generator and then it produces a random 8-bit output which is treated as keystream.By making the key more longer it is safe against brute force attacks. The longer the key the stronger security is achieved, preventing any attack.

ENCRYPTION
plaintext XOR KEYSTREAM --------------> ciphertext

DECRYPTION ciphertext XOR KEYSTREAM --------------> plaintext

BLOCK CIPHER

A block cipher takes a block of plaintext bits and generates a block of ciphertext bits, generally of same size. The size of block is fixed in the given scheme. The choice of block size does not directly affect to the strength of encryption scheme. The strength of cipher depends up on the key length.

Most modes require a unique binary sequence, often called an initialization vector, for each encryption operation. The IV has to be non-repeating and, for some modes, random as well. The initialization vector is used to ensure distinct ciphertexts are produced even when the same plaintext is encrypted multiple times independently with the same key.Block ciphers may be capable of operating on more than one block size, but during transformation the block size is always fixed. Block cipher modes operate on whole blocks and require that the last part of the data be padded to a full block if it is smaller than the current block size. There are, however, modes that do not require padding because they effectively use a block cipher as a stream cipher.