vana-sdk
Version:
A TypeScript library for interacting with Vana Network smart contracts
26 lines • 998 B
TypeScript
/**
* Utility functions for encryption related operations in the Vana SDK
*/
/**
* Encrypt a file key with a DLP's public key
* @param fileKey The symmetric key used to encrypt the file
* @param publicKey The DLP's public key
* @returns The encrypted key that can be stored on-chain
*/
export declare function encryptFileKey(fileKey: string, publicKey: string): Promise<string>;
/**
* Generate encryption parameters for secure file storage
* @returns An object containing the initialization vector and encryption key
*/
export declare function getEncryptionParameters(): {
iv: string;
key: string;
};
/**
* Decrypt data that was encrypted with the DLP's public key
* @param encryptedData The encrypted data
* @param privateKey The private key corresponding to the public key used for encryption
* @returns The decrypted data
*/
export declare function decryptWithPrivateKey(encryptedData: string, privateKey: string): Promise<string>;
//# sourceMappingURL=encryption.d.ts.map