Index
All Classes and Interfaces|All Packages|Constant Field Values
A
- AES_ALGORITHM_NAME - Static variable in class de.gustavblass.commons.crypto.Cryptor
-
The name of the encryption method used by this class, according to the Java Security Standard Algorithm Names documentation.
- ALGORITHM - Static variable in class de.gustavblass.commons.crypto.Cryptor
- ARGON2_D - Enum constant in enum class de.gustavblass.commons.crypto.Argon2Variant
- ARGON2_I - Enum constant in enum class de.gustavblass.commons.crypto.Argon2Variant
-
Argon2i is optimized to resist side-channel attacks. It accesses the memory array in a password independent order.
- ARGON2_ID - Enum constant in enum class de.gustavblass.commons.crypto.Argon2Variant
-
Argon2id is a hybrid version. It follows the Argon2i approach for the first half pass over memory and the Argon2d approach for subsequent passes. RFC 9106 recommends using Argon2id if you do not know the difference between the types or you consider side-channel attacks to be a viable threat.
Argon2id is optimized for more realistic settings, where the adversary can possibly access the same machine, use its CPU, or mount cold-boot attacks.
- ARGON2_ITERATIONS - Static variable in class de.gustavblass.commons.crypto.Cryptor
-
The default number of iterations to be used by the Argon2 key derivation function: 4.
- ARGON2_LENGTH_BYTES - Static variable in class de.gustavblass.commons.crypto.Cryptor
- ARGON2_MEMORY_KiB - Static variable in class de.gustavblass.commons.crypto.Cryptor
- ARGON2_PARALLELISM - Static variable in class de.gustavblass.commons.crypto.Cryptor
-
The default degree of parallelism to be used by the Argon2 key derivation function: 4.
- ARGON2_PASSWORD_PATTERN - Static variable in class de.gustavblass.commons.crypto.Cryptor
-
Matches the PHC string format for Argon2 password hints (i.e. without the password hash, which is used as a key for symmetric encryption).
- ARGON2_VARIANT - Static variable in class de.gustavblass.commons.crypto.Cryptor
-
The default variant of the Argon2 key derivation function:
Argon2Variant.ARGON2_ID. - ARGON2_VERSION - Static variable in class de.gustavblass.commons.crypto.Cryptor
- ARGON2_VERSION_16 - Enum constant in enum class de.gustavblass.commons.crypto.Argon2Version
-
Version 16 (decimal) = 10 (hex)
- ARGON2_VERSION_19 - Enum constant in enum class de.gustavblass.commons.crypto.Argon2Version
-
Version 19 (decimal) = 13 (hex)
- argon2Configuration - Variable in class de.gustavblass.commons.crypto.CipherText
- argon2Configuration - Variable in record class de.gustavblass.commons.crypto.Cryptor.KeyDerivationResult
-
The field for the
argon2Configurationrecord component. - argon2Configuration - Variable in class de.gustavblass.commons.crypto.HashingResult
-
The Argon2 parameters that were used to compute the hash.
- argon2Configuration() - Method in record class de.gustavblass.commons.crypto.Cryptor.KeyDerivationResult
-
Returns the value of the
argon2Configurationrecord component. - Argon2Configuration - Class in de.gustavblass.commons.crypto
-
The configuration of the Argon2 key derivation function.
- Argon2Configuration() - Constructor for class de.gustavblass.commons.crypto.Argon2Configuration
-
Creates a new Argon2 configuration with the default parameters and a randomly generated salt of 32 bytes length.
- Argon2Configuration(byte[]) - Constructor for class de.gustavblass.commons.crypto.Argon2Configuration
-
Creates a new Argon2 configuration with the default parameters and the provided salt.
- Argon2Configuration(Argon2Variant, Argon2Version, int, int, int, byte[]) - Constructor for class de.gustavblass.commons.crypto.Argon2Configuration
-
Constructs a new Argon2 configuration with the specified parameters.
- ARGON2ID_BASE64 - Static variable in class de.gustavblass.commons.crypto.Argon2Configuration
-
The string
argon2idin Base64 encoding. - Argon2Variant - Enum Class in de.gustavblass.commons.crypto
-
The variant of the Argon2 key derivation function that shall be used.
- Argon2Variant(int) - Constructor for enum class de.gustavblass.commons.crypto.Argon2Variant
- Argon2Version - Enum Class in de.gustavblass.commons.crypto
-
The revision of the Argon2 key derivation function that shall be used.
- Argon2Version(int) - Constructor for enum class de.gustavblass.commons.crypto.Argon2Version
B
- bytesToSecretKey(byte[]) - Static method in class de.gustavblass.commons.crypto.Cryptor
-
Converts an encryption key in the form of a byte array to a
SecretKeyobject.
C
- cipherText - Variable in class de.gustavblass.commons.crypto.CipherText
-
The secret message after it has been encrypted.
- CipherText - Class in de.gustavblass.commons.crypto
-
Represents a secret message that has been encrypted using the AES algorithm in Galois/Counter Mode (GCM).
- CipherText(byte[], byte[], Argon2Configuration) - Constructor for class de.gustavblass.commons.crypto.CipherText
-
Constructs a new
CipherTextobject with the provided message,CipherText.initialisationVectorand Argon2 parameters. - copy() - Method in class de.gustavblass.commons.crypto.Argon2Configuration
- copy() - Method in class de.gustavblass.commons.crypto.CipherText
- copy() - Method in class de.gustavblass.commons.crypto.HashingResult
-
Creates a deep copy of this
HashingResultobject. - Cryptor - Class in de.gustavblass.commons.crypto
-
Provides methods for symmetric encryption using the AES algorithm in GCM mode and for deriving encryption keys from human-readable passwords using the Argon2 key derivation function.
- Cryptor() - Constructor for class de.gustavblass.commons.crypto.Cryptor
- Cryptor.KeyDerivationResult - Record Class in de.gustavblass.commons.crypto
-
The result of a key derivation operation.
D
- de.gustavblass.commons.crypto - package de.gustavblass.commons.crypto
- decrypt(byte[]) - Method in class de.gustavblass.commons.crypto.CipherText
-
Converts the secret message from its encrypted form back to its human-readable form, using the AES algorithm in Galois/Counter Mode (GCM).
- derivedKey - Variable in record class de.gustavblass.commons.crypto.Cryptor.KeyDerivationResult
-
The field for the
derivedKeyrecord component. - derivedKey() - Method in record class de.gustavblass.commons.crypto.Cryptor.KeyDerivationResult
-
Returns the value of the
derivedKeyrecord component. - deriveKeyFromPassword(byte[]) - Static method in class de.gustavblass.commons.crypto.Cryptor
- deriveKeyFromPassword(byte[], byte[]) - Static method in class de.gustavblass.commons.crypto.Cryptor
- deriveKeyFromPassword(byte[], Argon2Configuration, int) - Static method in class de.gustavblass.commons.crypto.Cryptor
-
Converts a given human-readable password into a key of the given length, using the Argon2 key derivation function.
- DEVELOPER_EMAIL_ADDRESS - Static variable in class de.gustavblass.commons.crypto.PGP
-
The e-mail address of the developer who shall be able to decrypt the encrypted messages.
- DEVELOPER_PUBLIC_KEY - Static variable in class de.gustavblass.commons.crypto.PGP
-
The developer's public key in ASCII-armored format.
E
- EFF_WORD_LIST - Static variable in class de.gustavblass.commons.crypto.PasswordGenerator
-
The EFF word list, a list of 7776 words that can be used to generate passphrases.
- encrypt(byte[], String, String...) - Static method in class de.gustavblass.commons.crypto.PGP
-
PGP-encrypts the given plaintext using the given primary public key of the main recipient and, optionally, simultaneously with other recipients' public keys as well.
- encrypt(File, boolean, String, String...) - Static method in class de.gustavblass.commons.crypto.PGP
-
PGP-encrypts the given plaintext using the given primary public key of the main recipient and, optionally, simultaneously with other recipients' public keys as well.
- encrypt(File, String, String...) - Static method in class de.gustavblass.commons.crypto.PGP
-
PGP-encrypts the given plaintext using the given primary public key of the main recipient and, optionally, simultaneously with other recipients' public keys as well.
- encrypt(InputStream, boolean, String, String...) - Static method in class de.gustavblass.commons.crypto.PGP
-
PGP-encrypts the given plaintext using the given primary public key of the main recipient and, optionally, simultaneously with other recipients' public keys as well.
- encrypt(String, byte[]) - Static method in class de.gustavblass.commons.crypto.Cryptor
- encrypt(String, String, String...) - Static method in class de.gustavblass.commons.crypto.PGP
-
PGP-encrypts the given plaintext using the given primary public key of the main recipient and, optionally, simultaneously with other recipients' public keys as well.
- encryptToDevelopers(String) - Static method in class de.gustavblass.commons.crypto.PGP
-
PGP-encrypts the given plaintext using the developer's public key, so that only the developer will be able to decrypt it.
- encryptToDevelopers(String, String...) - Static method in class de.gustavblass.commons.crypto.PGP
-
PGP-encrypts the given plaintext using the developer's public key and the given additional public keys, so that only the developer and the recipients will be able to decrypt it.
- equals(HashingResult) - Method in class de.gustavblass.commons.crypto.HashingResult
-
Compares all fields of this object to the fields of another
HashingResultobject. - equals(Object) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
-
Compares all fields of this
Argon2Configurationto the fields of another one (if it is anArgon2Configurationat all). - equals(Object) - Method in class de.gustavblass.commons.crypto.CipherText
-
Compares the field's values of this
CipherTextobject to those of another object. - equals(Object) - Method in record class de.gustavblass.commons.crypto.Cryptor.KeyDerivationResult
-
Indicates whether some other object is "equal to" this one.
- estimatePasswordStrength(char[]) - Static method in class de.gustavblass.commons.crypto.PasswordGenerator
-
Uses the
Zxcvbnlibrary to check how hard the given passsword is to guess.
F
- FAIR - Enum constant in enum class de.gustavblass.commons.crypto.PasswordGenerator.PasswordStrength
-
The password is not too hard to guess.
- fromBase64(String) - Static method in class de.gustavblass.commons.crypto.Argon2Configuration
-
Converts a Base64-encoded string representation of an
Argon2Configurationback to anArgon2Configurationobject. - fromBase64(String) - Static method in class de.gustavblass.commons.crypto.CipherText
G
- generatePassphrase() - Method in class de.gustavblass.commons.crypto.PasswordGenerator
-
Generates a securely random passphrase consisting of 6 words from the EFF word list.
- generateRandomBytes(int) - Static method in class de.gustavblass.commons.crypto.Cryptor
-
Securely creates an array of randomly generated bytes.
- getArgon2Configuration() - Method in class de.gustavblass.commons.crypto.HashingResult
- GOOD - Enum constant in enum class de.gustavblass.commons.crypto.PasswordGenerator.PasswordStrength
-
The password is hard to guess.
H
- hash - Variable in class de.gustavblass.commons.crypto.HashingResult
- hash(byte[]) - Static method in class de.gustavblass.commons.crypto.Cryptor
-
Hashes the given input using the Argon2 hash function with the default parameters:
- hash(byte[], Argon2Configuration) - Static method in class de.gustavblass.commons.crypto.Cryptor
-
Hashes the given input using the Argon2 hash function with the parameters specified in the given
Argon2Configuration. - hashCode() - Method in record class de.gustavblass.commons.crypto.Cryptor.KeyDerivationResult
-
Returns a hash code value for this object.
- HashingResult - Class in de.gustavblass.commons.crypto
-
The result of a hashing operation.
- HashingResult(byte[], Argon2Configuration) - Constructor for class de.gustavblass.commons.crypto.HashingResult
-
Constructs a new
HashingResultobject with the provided Argon2 hash and the Argon2 parameters that were used to compute the hash.
I
- INITIALISATION_VECTOR_BYTES - Static variable in class de.gustavblass.commons.crypto.Cryptor
-
The AES-GCM specification recommends that the initialisation vector should be 96 bits = 12 bytes long.
- initialisationVector - Variable in class de.gustavblass.commons.crypto.CipherText
- iterations - Variable in class de.gustavblass.commons.crypto.Argon2Configuration
-
Number of passes (used to tune the running time independently of the memory size).
K
- KEY_SIZE_BYTES - Static variable in class de.gustavblass.commons.crypto.Cryptor
-
The default length of the encryption secret: 32 bytes = 256 bits.
- KeyDerivationResult(byte[], Argon2Configuration) - Constructor for record class de.gustavblass.commons.crypto.Cryptor.KeyDerivationResult
-
Creates an instance of a
KeyDerivationResultrecord class.
L
- label - Variable in enum class de.gustavblass.commons.crypto.PasswordGenerator.PasswordStrength
- LOG - Static variable in class de.gustavblass.commons.crypto.Argon2Configuration
- LOG - Static variable in class de.gustavblass.commons.crypto.CipherText
- LOG - Static variable in class de.gustavblass.commons.crypto.Cryptor
- LOG - Static variable in class de.gustavblass.commons.crypto.HashingResult
- LOG - Static variable in class de.gustavblass.commons.crypto.PasswordGenerator
- LOG - Static variable in class de.gustavblass.commons.crypto.PGP
M
- MAXIMUM_PARALLELISM - Static variable in class de.gustavblass.commons.crypto.Argon2Configuration
- memory - Variable in class de.gustavblass.commons.crypto.Argon2Configuration
-
The memory size m MUST be a number of kibibytes from 8*p to 2^(32)-1.
- MINIMUM_PARALLELISM_FACTOR_FOR_MEMORY - Static variable in class de.gustavblass.commons.crypto.Argon2Configuration
-
The Argon2 specification requires that
m >= 8 * p, wheremis thememorysize in kibibytes andpis the degree ofparallelism.
P
- parallelism - Variable in class de.gustavblass.commons.crypto.Argon2Configuration
-
KnownDegree of parallelism p determines how many independent (but synchronising) computational chains (lanes) can be run.
- parse(String) - Static method in class de.gustavblass.commons.crypto.Argon2Configuration
- parse(String) - Static method in class de.gustavblass.commons.crypto.CipherText
-
Converts a string representation of a
CipherTextobject back to a CipherText object. - parse(String) - Static method in class de.gustavblass.commons.crypto.HashingResult
-
Converts the string representation of a
HashingResultobject back to a HashingResult object. - parseBase64(String) - Static method in class de.gustavblass.commons.crypto.HashingResult
-
Converts the base64 string representation of a
HashingResultobject back to a HashingResult object. - PasswordGenerator - Class in de.gustavblass.commons.crypto
-
A class that generates secure passwords and passphrases.
- PasswordGenerator() - Constructor for class de.gustavblass.commons.crypto.PasswordGenerator
-
Loads the EFF word list from the resources.
- PasswordGenerator.PasswordStrength - Enum Class in de.gustavblass.commons.crypto
-
Indicates how hard it is to guess a specific password.
- PasswordStrength(String) - Constructor for enum class de.gustavblass.commons.crypto.PasswordGenerator.PasswordStrength
- PGP - Class in de.gustavblass.commons.crypto
-
A utility class to PGP-encrypt plaintext messages.
- PGP() - Constructor for class de.gustavblass.commons.crypto.PGP
S
- salt - Variable in class de.gustavblass.commons.crypto.Argon2Configuration
-
The nonce (number used once) that must be unique for each key.
- setIterations(int) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
-
Updates the number of
iterationsof this configuration. - setMemory(int) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
-
Updates the
memorysize m of this configuration. - setParallelism(int) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
-
Updates the degree of
parallelismp of this configuration. - setSalt(byte[]) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
-
Updates the
saltof this configuration. - setVariant(Argon2Variant) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
- setVersion(Argon2Version) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
- STRONG - Enum constant in enum class de.gustavblass.commons.crypto.PasswordGenerator.PasswordStrength
-
The password is very hard to guess.
T
- TAG_LENGTH_BITS - Static variable in class de.gustavblass.commons.crypto.Cryptor
-
The length of the tag: 128 bits = 16 bytes.
- toArgon2PasswordHint() - Method in class de.gustavblass.commons.crypto.Argon2Configuration
-
Converts this configuration to a PHC string, but without the password hash, i.e.
- toBase64() - Method in class de.gustavblass.commons.crypto.Argon2Configuration
-
Converts this configuration to the format
$base64$base64$base64$base64where the four Base64 strings are: - toBase64() - Method in class de.gustavblass.commons.crypto.CipherText
-
Converts the secret message to a string representation that contains all the information necessary to convert it back to a
CipherTextobject and decrypt the message again. - toBase64() - Method in class de.gustavblass.commons.crypto.HashingResult
-
Converts the
HashingResult.hashand theHashingResult.argon2Configurationto a string representation that contains all the information necessary to convert it back to aHashingResultobject. - toString() - Method in class de.gustavblass.commons.crypto.Argon2Configuration
-
Alias for
toArgon2PasswordHint(). - toString() - Method in class de.gustavblass.commons.crypto.CipherText
-
Converts the secret message to a string representation that contains all the information necessary to convert it back to a
CipherTextobject and decrypt the message again. - toString() - Method in record class de.gustavblass.commons.crypto.Cryptor.KeyDerivationResult
-
Returns a string representation of this record class.
- toString() - Method in class de.gustavblass.commons.crypto.HashingResult
-
Converts the
HashingResult.hashand theHashingResult.argon2Configurationto a string representation that contains all the information necessary to convert it back to aHashingResultobject.
U
- UNKNOWN - Enum constant in enum class de.gustavblass.commons.crypto.PasswordGenerator.PasswordStrength
-
The strength of the password could not be estimated.
V
- validatePublicKey(String) - Static method in class de.gustavblass.commons.crypto.PGP
-
Checks whether the given OpenPGP public key can be used to encrypt messages.
- valueOf(String) - Static method in enum class de.gustavblass.commons.crypto.Argon2Variant
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class de.gustavblass.commons.crypto.Argon2Version
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class de.gustavblass.commons.crypto.PasswordGenerator.PasswordStrength
-
Returns the enum constant of this class with the specified name.
- values() - Static method in enum class de.gustavblass.commons.crypto.Argon2Variant
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class de.gustavblass.commons.crypto.Argon2Version
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class de.gustavblass.commons.crypto.PasswordGenerator.PasswordStrength
-
Returns an array containing the constants of this enum class, in the order they are declared.
- variant - Variable in class de.gustavblass.commons.crypto.Argon2Configuration
-
The variant of the Argon2 key derivation function that shall be used.
- variant - Variable in enum class de.gustavblass.commons.crypto.Argon2Variant
- verify(String) - Method in class de.gustavblass.commons.crypto.HashingResult
-
Verifies that this hash is the hash of the provided input text.
- version - Variable in class de.gustavblass.commons.crypto.Argon2Configuration
-
The revision of the Argon2 key derivation function.
- version - Variable in enum class de.gustavblass.commons.crypto.Argon2Version
- VERY_STRONG - Enum constant in enum class de.gustavblass.commons.crypto.PasswordGenerator.PasswordStrength
-
The password is almost impossible to guess.
W
- WEAK - Enum constant in enum class de.gustavblass.commons.crypto.PasswordGenerator.PasswordStrength
-
The password is easy to guess.
All Classes and Interfaces|All Packages|Constant Field Values