tuweni / org.apache.tuweni.crypto.sodium / SecretBox / encryptDetached

encryptDetached

static fun encryptDetached(message: Bytes!, key: Key!, nonce: Nonce!): DetachedEncryptionResult! (source)

Encrypt a message with a key, generating a detached message authentication code.

Parameters

message - Bytes!: The message to encrypt.

key - Key!: The key to use for encryption.

nonce - Nonce!: A unique nonce.

Return
DetachedEncryptionResult!: The encrypted data and message authentication code.

static fun encryptDetached(message: ByteArray!, key: Key!, nonce: Nonce!): DetachedEncryptionResult! (source)

Encrypt a message with a key, generating a detached message authentication code.

Parameters

message - ByteArray!: The message to encrypt.

key - Key!: The key to use for encryption.

nonce - Nonce!: A unique nonce.

Return
DetachedEncryptionResult!: The encrypted data and message authentication code.

static fun encryptDetached(message: Bytes!, password: String!): DetachedEncryptionResult! (source)

Encrypt a message with a password, generating a detached message authentication code, using PasswordHash for the key generation (with the currently recommended algorithm and limits on operations and memory that are suitable for most use-cases).

Parameters

message - Bytes!: The message to encrypt.

password - String!: The password to use for encryption.

Return
DetachedEncryptionResult!: The encrypted data and message authentication code.

static fun encryptDetached(message: ByteArray!, password: String!): DetachedEncryptionResult! (source)

Encrypt a message with a password, generating a detached message authentication code, using PasswordHash for the key generation (with the currently recommended algorithm and limits on operations and memory that are suitable for most use-cases).

Parameters

message - ByteArray!: The message to encrypt.

password - String!: The password to use for encryption.

Return
DetachedEncryptionResult!: The encrypted data and message authentication code.

static fun encryptDetached(message: Bytes!, password: String!, algorithm: Algorithm!): DetachedEncryptionResult! (source)

Encrypt a message with a password, generating a detached message authentication code, using PasswordHash for the key generation (with limits on operations and memory that are suitable for most use-cases).

Parameters

message - Bytes!: The message to encrypt.

password - String!: The password to use for encryption.

algorithm - Algorithm!: The algorithm to use.

Return
DetachedEncryptionResult!: The encrypted data and message authentication code.

static fun encryptDetached(message: ByteArray!, password: String!, algorithm: Algorithm!): DetachedEncryptionResult! (source)

Encrypt a message with a password, generating a detached message authentication code, using PasswordHash for the key generation (with limits on operations and memory that are suitable for most use-cases).

Parameters

message - ByteArray!: The message to encrypt.

password - String!: The password to use for encryption.

algorithm - Algorithm!: The algorithm to use.

Return
DetachedEncryptionResult!: The encrypted data and message authentication code.

static fun encryptDetached(message: Bytes!, password: String!, opsLimit: Long, memLimit: Long, algorithm: Algorithm!): DetachedEncryptionResult! (source)

Encrypt a message with a password, generating a detached message authentication code, using PasswordHash for the key generation

Parameters

message - Bytes!: The message to encrypt.

password - String!: The password to use for encryption.

opsLimit - Long: The operations limit, which must be in the range PasswordHash#minOpsLimit() to PasswordHash#maxOpsLimit().

memLimit - Long: The memory limit, which must be in the range PasswordHash#minMemLimit() to PasswordHash#maxMemLimit().

algorithm - Algorithm!: The algorithm to use.

Return
DetachedEncryptionResult!: The encrypted data and message authentication code.

static fun encryptDetached(message: ByteArray!, password: String!, opsLimit: Long, memLimit: Long, algorithm: Algorithm!): DetachedEncryptionResult! (source)

Encrypt a message with a password, generating a detached message authentication code, using PasswordHash for the key generation.

Parameters

message - ByteArray!: The message to encrypt.

password - String!: The password to use for encryption.

opsLimit - Long: The operations limit, which must be in the range PasswordHash#minOpsLimit() to PasswordHash#maxOpsLimit().

memLimit - Long: The memory limit, which must be in the range PasswordHash#minMemLimit() to PasswordHash#maxMemLimit().

algorithm - Algorithm!: The algorithm to use.

Return
DetachedEncryptionResult!: The encrypted data and message authentication code.