- java.lang.Object
-
- java.lang.Enum<Mode>
-
- io.github.astrapi69.crypt.api.mode.Mode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Mode>
public enum Mode extends java.lang.Enum<Mode>
The enumMode
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
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BC
The BC mode that represents the Block Chaining ModeCBC
The CBC operation mode that represents the Cipher Block Chaining Mode, as defined in FIPS PUB 81.CCM
The CCM operation mode that represents the Counter/CBC Mode, as defined in NIST Special Publication SP 800-38DCFB
The CFB operation mode that represents the Cipher Block Feedback Mode, as defined in FIPS PUB 81CFBx
The CFBx operation mode that represents the Cipher Block Feedback Mode, as defined in FIPS PUB 81CTR
The CTR operation mode that represents a simplification of OFB, Counter mode updates the input block as a counter.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, 1996ECB
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
The GCM operation mode that represents the Galois/Counter Mode, as defined in NIST Special Publication SP 800-38DOFB
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.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.PCBC
The PCBC operation mode that represents the Propagating Cipher Block Chaining Mode, as defined in FIPS PUB 81UNKNOWN
The enum constant 'UNKNOWN' if the mode is unknown
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Mode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Mode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 Detail
-
values
public static Mode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Mode c : Mode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Mode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-