triplesec

Triple Security for the browser and Node.js

  • 所有者: keybase/triplesec
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

node-triplesec

A CommonJS module for symmetric key encryption of smallish secrets

How to install

npm install triplesec

How to Use

One-shot Mode

{encrypt, decrypt} = require 'triplesec'

key = new Buffer 'top-secret-pw'
pt0 = new Buffer 'the secret!'
pt1 = new Buffer pt0
encrypt { key, data : pt1 }, (err, ciphertext) ->
	decrypt { key, data : ciphertext }, (err, pt2) ->
		console.log "Right back the start! #{pt0} is #{pt2}"

Reusable Derived Keys

The most expensive part of TripleSec is to derive keys from your
given passphrase. This is intentionally so to make it more expensive
to crack your password in the case that your ciphertext is stolen.
However, you can spread this expense over multiple encryptions
if you plan to be encrypting more than once:

{Encryptor, Decryptor} = require 'triplesec'

key = new Buffer 'top-secret-pw'
enc = new Encryptor { key }
dec = new Decryptor { key }
pt0 = new Buffer 'the secret!'
pt1 = new Buffer pt0
pt2 = new Buffer pt0
enc.run { data : pt1 }, (err, ct1) ->
	enc.run { data : pt2 }, (err, ct2) ->
		dec.run { data : ct1 }, (err, pt3) ->
			dec.run { data : ct2 }, (err, pt4) ->
				console.log "Right back the start! #{pt0} is #{pt3} is #{pt4}"

If you want to resalt derived keys with every encryption, you should explicitly
ask for that. Otherwise, salt will be reused to speed up encryption
(and decryption).

enc.run { data : pt1 }, (err, ct1) ->
	enc.resalt {}, () ->
		enc.run { data : pt2 }, (err, ct2) ->

Full API Documentation

Documentation generated by codo
is available here.

主要指標

概覽
名稱與所有者keybase/triplesec
主編程語言JavaScript
編程語言Makefile (語言數: 8)
平台
許可證MIT License
所有者活动
創建於2013-08-28 15:40:48
推送於2023-04-15 14:09:22
最后一次提交2020-03-24 10:28:09
發布數36
最新版本名稱v4.0.3 (發布於 2019-02-01 16:23:56)
第一版名稱v0.0.1 (發布於 2013-09-16 16:16:08)
用户参与
星數401
關注者數21
派生數47
提交數589
已啟用問題?
問題數68
打開的問題數23
拉請求數11
打開的拉請求數8
關閉的拉請求數3
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?