Inherits from NSObject
Declared in AGSecretBox.h
AGSecretBox.m

Overview

Provide symmetric key authenticated encryption via xsalsa20poly1305

Instance Methods

decrypt:nonce:error:

Decrypts the data object provided given a nonce.

- (NSData *)decrypt:(NSData *)data nonce:(NSData *)nonce error:(NSError *__autoreleasing *)error

Parameters

data

The data object(cipher) to decrypt.

nonce

The cryptographically secure pseudorandom number.

error

If an error occurs, upon return contains an NSError object that describes the problem.

Return Value

An NSData object that holds the decrypted data.

Discussion

Decrypts the data object provided given a nonce.

Declared In

AGSecretBox.h

encrypt:nonce:error:

Encrypts and authenticates the data object provided given a nonce.

- (NSData *)encrypt:(NSData *)data nonce:(NSData *)nonce error:(NSError *__autoreleasing *)error

Parameters

data

The data object to encrypt.

nonce

the cryptographically secure pseudorandom number.

error

If an error occurs, upon return contains an NSError object that describes the problem.

Return Value

An NSData object that holds the encrypted(cipher) data.

Discussion

Encrypts and authenticates the data object provided given a nonce.

Declared In

AGSecretBox.h

initWithKey:

Secret box default initialization

- (id)initWithKey:(NSData *)key

Parameters

key

the private encryption key provided.

Return Value

the AGSecretBox object.

Discussion

Secret box default initialization

Declared In

AGSecretBox.h