Index

A B C D E F G H I K L M P S T U V W 
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
The encryption method used by this class: AES in GCM mode without padding and with an enforced key size of 256 bits.
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.

Wikipedia

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.

Wikipedia

Argon2id is optimized for more realistic settings, where the adversary can possibly access the same machine, use its CPU, or mount cold-boot attacks.

RFC 9106, Section 4

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
The default length of the Argon2 hash: 32 bytes = 256 bits.
ARGON2_MEMORY_KiB - Static variable in class de.gustavblass.commons.crypto.Cryptor
The default memory size (in kibibytes) to be used by the Argon2 key derivation function: 256 MiB.
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
The default version of the Argon2 key derivation function: 19 (decimal) = 13 (hex).
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
The Argon2 parameters that were used to derive the AES encryption key from the user's human-readable password.
argon2Configuration - Variable in record class de.gustavblass.commons.crypto.Cryptor.KeyDerivationResult
The field for the argon2Configuration record 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 argon2Configuration record 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 argon2id in 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 SecretKey object.

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 CipherText object with the provided message, CipherText.initialisationVector and 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 HashingResult object.
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 derivedKey record component.
derivedKey() - Method in record class de.gustavblass.commons.crypto.Cryptor.KeyDerivationResult
Returns the value of the derivedKey record component.
deriveKeyFromPassword(byte[]) - Static method in class de.gustavblass.commons.crypto.Cryptor
Converts a given human-readable password into a 256-bit key suitable for AES encryption, using the Argon2 key derivation function.
deriveKeyFromPassword(byte[], byte[]) - Static method in class de.gustavblass.commons.crypto.Cryptor
Converts a given human-readable password into a 256-bit key suitable for AES encryption, using the Argon2 key derivation function.
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
Uses the AES encryption algorithm in GCM mode to encrypt a given plaintext with a given password and a randomly generated initialisation vector.
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 HashingResult object.
equals(Object) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
Compares all fields of this Argon2Configuration to the fields of another one (if it is an Argon2Configuration at all).
equals(Object) - Method in class de.gustavblass.commons.crypto.CipherText
Compares the field's values of this CipherText object 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 Zxcvbn library 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 Argon2Configuration back to an Argon2Configuration object.
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
The Argon2 hash of the input text.
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 HashingResult object 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
The initialisation vector (nonce) that was passed to the AES in Galois/Counter Mode.
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 KeyDerivationResult record 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, where m is the memory size in kibibytes and p is the degree of parallelism.

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
Converts an Argon2 password hint back to an Argon2Configuration.
parse(String) - Static method in class de.gustavblass.commons.crypto.CipherText
Converts a string representation of a CipherText object back to a CipherText object.
parse(String) - Static method in class de.gustavblass.commons.crypto.HashingResult
Converts the string representation of a HashingResult object back to a HashingResult object.
parseBase64(String) - Static method in class de.gustavblass.commons.crypto.HashingResult
Converts the base64 string representation of a HashingResult object 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 iterations of this configuration.
setMemory(int) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
Updates the memory size m of this configuration.
setParallelism(int) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
Updates the degree of parallelism p of this configuration.
setSalt(byte[]) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
Updates the salt of this configuration.
setVariant(Argon2Variant) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
Updates the variant of the Argon2 key derivation function that shall be used.
setVersion(Argon2Version) - Method in class de.gustavblass.commons.crypto.Argon2Configuration
Updates the version of the Argon2 key derivation function that shall be used.
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$base64 where 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 CipherText object and decrypt the message again.
toBase64() - Method in class de.gustavblass.commons.crypto.HashingResult
Converts the HashingResult.hash and the HashingResult.argon2Configuration to a string representation that contains all the information necessary to convert it back to a HashingResult object.
toString() - Method in class de.gustavblass.commons.crypto.Argon2Configuration
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 CipherText object 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.hash and the HashingResult.argon2Configuration to a string representation that contains all the information necessary to convert it back to a HashingResult object.

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.
A B C D E F G H I K L M P S T U V W 
All Classes and Interfaces|All Packages|Constant Field Values