Pot.Arc4

{Pot.Arc4} new Pot.Arc4 ([{String} key])

Pot.js で利用可能。 PotLite.js では利用できません。

新しい Pot.Arc4 インスタンスを生成します。

Pot.Arc4 の新しいインスタンスを生成します。
任意に、引数 key に鍵を渡すことができます。
コンストラクタで鍵を渡さなかった場合、setKey() で設定できます。

Pot.globalize() が適応されている場合、new Pot.Arc4() が new Arc4() で実行できます。

新しい Pot.Arc4 インスタンスが返ります。

var arc4 = new Pot.Arc4('hoge');

// 暗号化
var cipherText = arc4.encrypt('Hello World!');
debug('cipherText = ' + cipherText); // 'cipherText = (...cipherText)'

// 復号化
var origText = arc4.decrypt(cipherText);
debug('origText = ' + origText); // 'origText = Hello World!'