项目作者: m1ga

项目描述 :
使用RSA进行非对称加密(私钥/公钥)
高级语言: Java
项目地址: git://github.com/m1ga/ti-crypt.git
创建时间: 2015-09-13T12:48:27Z
项目社区:https://github.com/m1ga/ti-crypt

开源协议:

下载


Asymmetric Encryption with RSA for Titanium (Android)

iOS Version: https://github.com/moritzknecht/TiRSA

RSA Example:

  1. var crypt = require("miga.ticrypt");
  2. var keypair = crypt.generateKeyPair();
  3. console.log("Pub: " + keypair.publicKey);
  4. console.log("Priv: " + keypair.privateKey);
  5. var txt = crypt.encode({
  6. plainText: "test text",
  7. publicKey: keypair.publicKey
  8. });
  9. console.log("Encode: " + txt);
  10. var txt_decode = crypt.decode({
  11. cipherText: txt,
  12. privateKey: keypair.privateKey
  13. });
  14. console.log("Decode: " + txt_decode);
  15. $.index.open();

AES Example:

  1. let crypt = require("miga.ticrypt");
  2. let aesCrypto = crypt.createCryptoAES();
  3. let aesKey = aesCrypto.generateKey();
  4. console.log("AES key: " + aesKey);
  5. let txt = aesCrypto.crypt(aesKey, "test text");
  6. console.log("AES Encode: " + txt);
  7. let txt_decode = aesCrypto.decrypt(txt, aesKey);
  8. console.log("AES Decode: " + txt_decode);

Contributions: