import sjcl, { SjclCipherEncryptParams } from '@aikon/sjcl'; import { AesEncryptedDataString, EncryptionMode, AesEncryptionOptions } from './aesCryptoModels'; export * from './aesCryptoModels'; export declare const defaultIter = 1000000; export declare const defaultMode = EncryptionMode.Gcm; /** Verifies that the value is a valid, stringified JSON Encrypted object */ export declare function isAesEncryptedDataString(value: string): value is AesEncryptedDataString; /** Ensures that the value comforms to a well-formed, stringified JSON Encrypted Object */ export declare function toAesEncryptedDataString(value: any): AesEncryptedDataString; /** Derive the key used for encryption/decryption */ export declare function deriveKey(password: string, iter: number, salt?: string): sjcl.BitArray; /** Decrypts the encrypted value with the derived key */ export declare function decryptWithKey(encrypted: AesEncryptedDataString | any, derivedKey: sjcl.BitArray): string; /** Decrypts the encrypted value using a password, and salt (and optional iter value) * Uses AES algorithm and SHA256 hash function * The encrypted value is either a stringified JSON object or a JSON object */ export declare function decryptWithPassword(encrypted: AesEncryptedDataString | any, password: string, options?: AesEncryptionOptions): string; /** Encrypts the private key with the derived key */ export declare function encryptWithKey(unencrypted: string, cryptoParams: SjclCipherEncryptParams, derivedKey: sjcl.BitArray): sjcl.SjclCipherEncrypted; /** Encrypts a string using a password and optional salt */ export declare function encryptWithPassword(unencrypted: string, password: string, options?: AesEncryptionOptions): AesEncryptedDataString;