Skip to content

Documentation


Documentation / @kizami/crypto / Encryptor

Interface: Encryptor ​

Defined in: encryptor.ts:22

Methods ​

decrypt() ​

decrypt(stored): Promise<string | null>

Defined in: encryptor.ts:29

保存値を復号する。"enc:" プレフィクスが無ければ平文とみなしそのまま返す。 復号できない場合(鍵不一致・破損・未知バージョン)は例外を投げず null を返す。

Parameters ​

stored ​

string

Returns ​

Promise<string | null>


encrypt() ​

encrypt(plain): Promise<string>

Defined in: encryptor.ts:24

平文を暗号化し "enc:v1:<ivBase64>:<ciphertextBase64>" を返す。

Parameters ​

plain ​

string

Returns ​

Promise<string>