Information on the OFB mode --------------------------- The OFB uses an initialization vector (z_0 = IV). This vector is encrypted using an encryption algorithm in ECB mode. The encrypted buffer is then XORed with the plaintext to get the ciphertext. z_i = e_k(z_i - 1) y_i = x_i ^ z_i i >= 1 z_i: This is the stream which is encrypted using the encryption algorithm. x_i: Plaintext. y_i: Ciphertext e_k: Encryption-Algorithm. The OFB mode is self-inverse, hence the same function is used for decryption. Links: http://www.rsasecurity.com/rsalabs/faq/2-1-4-5.html http://www.iks-jena.de/mitarb/lutz/security/cryptfaq/q83.html