OCB mode

From HandWiki
Short description: Authenticated encryption mode of operation for block ciphers

Offset codebook mode (OCB mode) is an authenticated encryption mode of operation for cryptographic block ciphers.[1][2] OCB mode was designed by Phillip Rogaway, who credits Mihir Bellare, John Black, and Ted Krovetz with assistance and comments on the designs. It is based on the integrity-aware parallelizeable mode (IAPM) of authenticated encryption by Charanjit S. Jutla. The OCB2 version was proven insecure, while the original OCB1 as well as OCB3 from 2011 are still considered secure.

Encryption and authentication

OCB mode was designed to provide both message authentication and privacy. It is essentially a scheme for integrating a message authentication code (MAC) into the operation of a block cipher. In this way, OCB mode avoids the need to use two systems: a MAC for authentication and encryption for privacy. This results in lower computational cost compared to using separate encryption and authentication functions.

There are three versions of OCB: OCB1, OCB2 and OCB3. OCB1 was published in 2001. OCB2 improves on OCB1 by allowing associated data to be included with the message, providing authenticated encryption with associated data (AEAD; that is, data that are not encrypted but should be authenticated) and a new method for generating a sequence of offsets. OCB2 was first published in 2003, originally named authenticated-encryption mode, or advanced encryption mode (AEM) and was shown to be completely insecure in 2019. OCB3, published in 2011, changes again the way offsets are computed and introduces minor performance improvements.

OCB mode is listed as an optional method in the IEEE 802.11 wireless security standard as an alternative to counter with CBC-MAC mode (CCM). OCB2 is standardized in ISO/IEC 19772:2009[3] and a modified OCB3 in RFC 7253.[4] The RFC encodes the tag length into the internally formatted nonce.


OCB performance overhead is minimal compared to classical, non-authenticating modes like cipher block chaining. OCB requires one block cipher operation per block of encrypted and authenticated message, and one block cipher operation per block of associated data. There is also one extra block cipher operation required at the end of process.

For comparison, CCM mode offering similar functionality requires twice as many block cipher operations per message block (associated data requires one, as in OCB).


Two U.S. patents have been issued for OCB mode.[5] However, a special exemption is granted allowing OCB mode to be used in software licensed under the GNU General Public License without cost, as well as for any non-commercial, non-governmental application. This constraint has hindered approval by the National Institute of Standards and Technology.

Since the authors have only applied for patent protection in the U.S., the algorithm is free to use in software not developed and not sold inside the U.S.[6]

By January 2013, the author has granted a free license for any open source license certified by the Open Source Initiative.[7]

The U.S. patents were intentionally abandoned in 2021.[8]


Niels Ferguson pointed out collision attacks on OCB, which limits the amount of data that can be securely processed under a single key to about 280 terabytes.[9][10]

In October 2018, Inoue and Minematsu presented an existential forgery attack against OCB2 that requires only a single prior encryption query and almost no computational power or storage.[11] The attack does not extend to OCB1 or OCB3, and it requires that the associated data field of the forged ciphertext be empty. Poettering[12] and Iwata[13] improved the forgery attack to a full plaintext recovery attack just a couple of days later. The four authors later produced a joint report.[14]

See also


  1. Ted Krovetz, Phillip Rogaway (July 23, 2012). "The OCB Authenticated-Encryption Algorithm". http://datatracker.ietf.org/doc/draft-krovetz-ocb/?include_text=1. 
  2. Phillip Rogaway. "OCB Mode". http://www.cs.ucdavis.edu/~rogaway/ocb/. 
  3. "ISO/IEC 19772:2009 Information technology -- Security techniques -- Authenticated encryption". ISO. 2009-02-12. http://www.iso.org/iso/catalogue_detail?csnumber=46345. 
  4. "The OCB Authenticated-Encryption Algorithm". IETF. 2014. https://tools.ietf.org/html/rfc7253. 
  5. Phillip Rogaway. "OCB FAQ - Is OCB Patented". http://www.cs.ucdavis.edu/~rogaway/ocb/ocb-faq.htm#patent:phil. 
  6. Phillip Rogaway (29 March 2005). "OCB: Offer Letter". http://www.cs.ucdavis.edu/~rogaway/ocb/offer.htm. 
  7. Phillip Rogaway (9 January 2013). "OCB: free licenses". http://www.cs.ucdavis.edu/~rogaway/ocb/license.htm. 
  8. Phillip Rogaway. "OCB patents are abandoned; freely usable". https://mailarchive.ietf.org/arch/msg/cfrg/qLTveWOdTJcLn4HP3ev-vrj05Vg/. 
  9. Niels Ferguson (2002-02-11). "Collision attacks on OCB". http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/comments/General_Comments/papers/Ferguson.pdf. 
  10. Phillip Rogaway (2015-02-27). "OCB: Background". http://web.cs.ucdavis.edu/~rogaway/ocb/ocb-faq.htm#ferguson. 
  11. Akiko Inoue and Kazuhiko Minematsu (2018-10-26). "Cryptanalysis of OCB2". https://eprint.iacr.org/2018/1040. 
  12. Bertram Poettering (2018-11-08). "Breaking the confidentiality of OCB2". https://eprint.iacr.org/2018/1087. 
  13. Tetsu Iwata (2018-11-11). "Plaintext Recovery Attack of OCB2". https://eprint.iacr.org/2018/1090. 
  14. "Cryptanalysis of OCB2: Attacks on Authenticity and Confidentiality". 2019-03-19. https://eprint.iacr.org/2019/311. 

External links