What is the difference between stream and block ciphers in cryptography?
Stream cipher is a cryptographic algorithm that enciphers or deciphers a message using a one element to one element basis. This means, it transforms a plaintext into ciphertext on a byte-by-byte or bit-by-bit basis. The elements of the message can be a character, a byte, or a bit of information that traverses through encryption/decryption algorithms using XORs and other operations. It is used to encrypt continuous streams of data and is particularly appropriate for audio and video streaming. Examples of stream cipher include RC4, SEAL, etc.
Block cipher, on the other hand, is a cryptographic algorithm that encrypts/decrypts a message of variable size and produces fixed-size blocks of outputs. The block can be a sequence of characters, bytes, bits or other units of information. It transforms a sequence of blocks of plaintext into a group of ciphertext bits using the same encryption algorithm. The block sizes can be 64, 128, 192, 256, etc. depending on the cryptosystem. And it is more appropriate for file transfer functions. Examples of block cipher include DES, AES, Twofish, Blowfish, Serpent, 3DES, etc.