iking-utils
Version:
金合前端工具库
26 lines (25 loc) • 818 B
TypeScript
import * as Cryptojs from 'crypto-js';
export interface EncryptionParams {
key: string;
iv: string;
}
interface Padding {
pad(data: Cryptojs.lib.WordArray, blockSize: number): void;
unpad(data: Cryptojs.lib.WordArray): void;
}
export declare class AesEncryption {
private key;
private iv;
constructor(opt?: Partial<EncryptionParams>);
get getOptions(): {
mode: any;
padding: Padding;
iv: Cryptojs.lib.WordArray | undefined;
};
encryptByAES(cipherText: string): string;
decryptByAES(cipherText: string): string;
}
export declare function encryptByBase64(cipherText: string): string;
export declare function decodeByBase64(cipherText: string): string;
export declare function encryptByMd5(password: string): string;
export {};