Search code examples
javac#encryptionbouncycastle

CTR mode of operation in the Bouncy Castle lightweight API?


Is there an implementation of CTR (counter) mode of operation in the Java / C# Bouncy Castle lightweight API?


Solution

  • Yes, you can use org.bouncycastle.crypto.modes.SICBlockCipher.

    The documentation of that class reads:

    Implements the Segmented Integer Counter (SIC) mode on top of a simple block cipher. This mode is also known as CTR mode.

    Note that the SICBlockCipher class does not seem to implement buffering of large key streams. It does also not provide functionality to encryption / decrypt from a specific offset within the key stream. At least not in versions of the class up to API level 1.51.