RNCryptor

public class RNCryptor: NSObject

RNCryptor encryption/decryption interface.

  • Encrypt data using password and return encrypted data.

    Declaration

    Swift

    public static func encryptData(data: NSData, password: String) -> NSData
  • Decrypt data using password and return decrypted data. Throws if password is incorrect or ciphertext is in the wrong format. - throws Error

    Declaration

    Swift

    public static func decryptData(data: NSData, password: String) throws -> NSData
  • Generates random NSData of given length Crashes if length is larger than allocatable memory, or if the system random number generator is not available.

    Declaration

    Swift

    public static func randomDataOfLength(length: Int) -> NSData
  • A encryptor for the latest data format. If compatibility with other RNCryptor implementations is required, you may wish to use the specific encryptor version rather than accepting latest.

    See more

    Declaration

    Swift

    public final class Encryptor: NSObject, RNCryptorType
  • Password-based decryptor that can handle any supported format.

    See more

    Declaration

    Swift

    public final class Decryptor : NSObject, RNCryptorType
  • V3 format settings

    See more

    Declaration

    Swift

    public final class FormatV3: NSObject
  • Format version 3 encryptor. Use this to ensure a specific format verison or when using keys (which are inherrently versions-specific). To use the latest encryptor with a password, use Encryptor instead.

    See more

    Declaration

    Swift

    public final class EncryptorV3 : NSObject, RNCryptorType
  • Format version 3 decryptor. This is required in order to decrypt using keys (since key configuration is version-specific). For password decryption, Decryptor is generally preferred, and will call this if appropriate.

    See more

    Declaration

    Swift

    public final class DecryptorV3: NSObject, VersionedDecryptorType