Structures
The following structures are available globally.
-
This structure represents padded plaintext. Blocks are acutally a byte array which is a multiple of a given block size.
See moreDeclaration
Swift
public struct Blocks
-
A ciphertext is an ecrypted message. In contrast to
See moreEncryptedData
it only contains the encrypted message, whileEncryptedData
might contain other information as well, such as a message authentication code et cetera.Declaration
Swift
public struct Ciphertext : EncryptedData
-
This class represents hashed passwords. They can be used to store passwords for the purpose of authenticating users. Passwords should not be stored as plaintext values to avoid compromise if they get in the wrong hands.
Example
See morelet password = Password("Correct Horse Battery Staple")! let hashedPassword = password.hash()! // Store `hashedPassword.string` to database. // If a user wants to authenticate, just read it from the database and // verify it against the password given by the user. if hashedPassword.isVerified(by: password) { // The user is authenticated successfully. }
Declaration
Swift
public struct HashedPassword
-
This can be used to securely generate random data.
See moreDeclaration
Swift
public struct Random