非死book的數據加密包:Conceal

jopen 9年前發布 | 30K 次閱讀 Conceal 安全相關

Conceal 是 非死book 推出的一個用來對數據進行快速加密和認證的開發包,應用可以使用它來加密數據和大文件存儲。Conceal 和其他加密軟件不同的是它提供了 Smorgasbord 加密算法和選項,這不是一個一般意義上的數據加密包,只是提供一些有用的方法。

非死book的數據加密包:Conceal

示例代碼:

// Creates a new Crypto object with default implementations of 
// a key chain as well as native library.
Crypto crypto = new Crypto(
  new SharedPrefsBackedKeyChain(context),
  new SystemNativeCryptoLibrary());

FileOutputStream fileStream = new FileOutputStream(file);

// Creates an output stream which encrypts the data as
// it is written to it and writes it out to the file.
OutputStream outputStream = crypto.getCipherOutputStream(
  fileStream,
  entity);

// Write plaintext to it.
outputStream.write(plainText);
outputStream.close();

項目主頁:http://www.baiduhome.net/lib/view/home/1424578047010

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!