Module crypt.api

Enum Class Mode

java.lang.Object
java.lang.Enum<Mode>
io.github.astrapi69.crypt.api.mode.Mode
All Implemented Interfaces:
Serializable, Comparable<Mode>, Constable

public enum Mode extends Enum<Mode>
The enum Mode defines the names that can be specified as the mode component in a transformation when requesting an instance of Cipher. For more info see: https://docs.oracle.com/en/java/javase/11/docs/specs/security/standard-names.html#cipher-algorithm-modes
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The BC mode that represents the Block Chaining Mode
    The CBC operation mode that represents the Cipher Block Chaining Mode, as defined in FIPS PUB 81.
    The CCM operation mode that represents the Counter/CBC Mode, as defined in NIST Special Publication SP 800-38D
    The CFB operation mode that represents the Cipher Block Feedback Mode, as defined in FIPS PUB 81
    The CFBx operation mode that represents the Cipher Block Feedback Mode, as defined in FIPS PUB 81
    The CTR operation mode that represents a simplification of OFB, Counter mode updates the input block as a counter.
    The CTS operation mode that represents the Cipher Text Stealing, as described in Bruce Schneier’s book Applied Cryptography-Second Edition, John Wiley and Sons, 1996
    The ECB operation mode that represents the Electronic Codebook Mode, as defined in FIPS PUB 81 (generally this mode should not be used for multiple blocks of data).
    The GCM operation mode that represents the Galois/Counter Mode, as defined in NIST Special Publication SP 800-38D
    The OFB operation mode that represents the Output Feedback Mode, as defined in FIPS PUB 81 Using modes such as CFB and OFB, block ciphers can encrypt data in units smaller than the cipher’s actual block size.
    The OFBx operation mode that represents the Output Feedback Mode, as defined in FIPS PUB 81 Using modes such as CFB and OFB, block ciphers can encrypt data in units smaller than the cipher’s actual block size.
    The PCBC operation mode that represents the Propagating Cipher Block Chaining Mode, as defined in FIPS PUB 81
    The enum constant 'UNKNOWN' if the mode is unknown
  • Method Summary

    Modifier and Type
    Method
    Description
    static Mode
    Returns the enum constant of this class with the specified name.
    static Mode[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • BC

      public static final Mode BC
      The BC mode that represents the Block Chaining Mode
    • CBC

      public static final Mode CBC
      The CBC operation mode that represents the Cipher Block Chaining Mode, as defined in FIPS PUB 81. Using modes such as CFB and OFB, block ciphers can encrypt data in units smaller than the cipher’s actual block size. When requesting such a mode, you may optionally specify the number of bits to be processed at a time by appending this number to the mode name as shown in the “DES/CFB8/NoPadding” and “DES/OFB32/PKCS5Padding” transformations. If no such number is specified, a provider-specific default is used. (For example, the SunJCE provider uses a default of 64 bits for DES.) Thus, block ciphers can be turned into byte-oriented stream ciphers by using an 8-bit mode such as CFB8 or OFB8.
    • CCM

      public static final Mode CCM
      The CCM operation mode that represents the Counter/CBC Mode, as defined in NIST Special Publication SP 800-38D
    • CFB

      public static final Mode CFB
      The CFB operation mode that represents the Cipher Block Feedback Mode, as defined in FIPS PUB 81
    • CFBx

      public static final Mode CFBx
      The CFBx operation mode that represents the Cipher Block Feedback Mode, as defined in FIPS PUB 81
    • CTR

      public static final Mode CTR
      The CTR operation mode that represents a simplification of OFB, Counter mode updates the input block as a counter.
    • CTS

      public static final Mode CTS
      The CTS operation mode that represents the Cipher Text Stealing, as described in Bruce Schneier’s book Applied Cryptography-Second Edition, John Wiley and Sons, 1996
    • ECB

      public static final Mode ECB
      The ECB operation mode that represents the Electronic Codebook Mode, as defined in FIPS PUB 81 (generally this mode should not be used for multiple blocks of data).
    • GCM

      public static final Mode GCM
      The GCM operation mode that represents the Galois/Counter Mode, as defined in NIST Special Publication SP 800-38D
    • OFB

      public static final Mode OFB
      The OFB operation mode that represents the Output Feedback Mode, as defined in FIPS PUB 81 Using modes such as CFB and OFB, block ciphers can encrypt data in units smaller than the cipher’s actual block size. When requesting such a mode, you may optionally specify the number of bits to be processed at a time by appending this number to the mode name as shown in the “DES/CFB8/NoPadding” and “DES/OFB32/PKCS5Padding” transformations. If no such number is specified, a provider-specific default is used. (For example, the SunJCE provider uses a default of 64 bits for DES.) Thus, block ciphers can be turned into byte-oriented stream ciphers by using an 8-bit mode such as CFB8 or OFB8.
    • OFBx

      public static final Mode OFBx
      The OFBx operation mode that represents the Output Feedback Mode, as defined in FIPS PUB 81 Using modes such as CFB and OFB, block ciphers can encrypt data in units smaller than the cipher’s actual block size. When requesting such a mode, you may optionally specify the number of bits to be processed at a time by appending this number to the mode name as shown in the “DES/CFB8/NoPadding” and “DES/OFB32/PKCS5Padding” transformations. If no such number is specified, a provider-specific default is used. (For example, the SunJCE provider uses a default of 64 bits for DES.) Thus, block ciphers can be turned into byte-oriented stream ciphers by using an 8-bit mode such as CFB8 or OFB8.
    • PCBC

      public static final Mode PCBC
      The PCBC operation mode that represents the Propagating Cipher Block Chaining Mode, as defined in FIPS PUB 81
    • UNKNOWN

      public static final Mode UNKNOWN
      The enum constant 'UNKNOWN' if the mode is unknown
  • Method Details

    • values

      public static Mode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Mode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null