/// export declare enum CryptoUtilsError { invalid_parameters = "invalid_parameters", } /** * Custom class for CryptoJS encryption serialization. */ export declare class CryptoJSAesJson { constructor(); stringify(cipherParams: any): string; parse(jsonStr: any): { ciphertext: any; iv: string; salt: string; }; } export declare class CryptoUtils { /** * Encrypts message with given private-pubic key pair * * @param {string} message Message to encrypt. * @param {string} privateKey Private of one side of communication, to encrypt message with. * @param {string} publicKey Public key of other side of communication, used in encryption. * @param {string} [nonce] Random number user in encryption process. Default ''. * @return {string} String in HEX format with encrypted message. */ static encryptWithChecksum(message: string, privateKey: string, publicKey: string, nonce?: string): string; /** * Decrypts message encrypted by CryptoUtils.encryptWithChecksum or memo from DCore network objects. * * @param {string} message Encrypted message. * @param {KeyPrivate} privateKey Private key of one of communicating sides. Used to decrypt message. * @param {KeyPublic} publicKey Public key of other communicating side. Used to decrypt message. * @param {string} nonce Random number used in decryption. Default ''. * @returns {Buffer} Buffer with decrypted text. */ static decryptWithChecksum(message: string, privateKey: string, publicKey: string, nonce?: string): string; /** * Calculate RIPEMD160 hash from input. * Used as 'hash' parameter when submitting content. * * @param {string} fromBuffer Input to calculate buffer from. * @returns {string} RIPEMD160 hashed text. */ static ripemdHash(fromBuffer: string): string; /** * Calculates MD5 hash out of input. * * @param {string} message Input message. * @returns {string} Hashed input. */ static md5(message: string): string; /** * Calculates SHA512 hash of input. * * @param message Input message. * @returns {string} Hashed input. */ static sha512(message: string): string; /** * Calculates SHA256 hash of input. * * @param message Input message. * @returns {string} Hashed input. */ static sha256(message: string): string; /** * Encrypt message using AES256-CBC. * Encrypted text is in string representation of following type * { * ct: string, * iv: string, * s: string * } * @param {string} message Message to be encrypted. * @param {string} password Password for encryption. * @returns {string} Encrypted serialized message. */ static encrypt(message: string, password: string): string; /** * Decrypt AES256-CBC encrypted message in form of string representation of following type * { * ct: string, * iv: string, * s: string * } * @param {string} message Serialized encrypted message to be decrypted. * @param {string} password Password for decryption. * @returns {string | null} Decrypted message. */ static decrypt(message: string, password: string): string | null; /** * Encrypt message with AES256-CBC. Result is encrypted hex string. * This encryption is compatible with wallet-cli wallet file export key encryption format. * * @param {string | Buffer} message Message to be encrypted. * @param {string} password Password for encryption. * @returns {string} Encrypted message. */ static encryptToHexString(message: string | Buffer, password: string): string; /** * Decrypts AES256-CBC encrypted hex string message. Result is decrypted string. * This decryption is compatible with wallet-cli wallet file export key encryption format. * * @param {string} message Message to be decrypted. * @param {string} password Password for decryption. * @returns {string} Decrypted message. */ static decryptHexString(message: string, password: string): string; }