Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
ancient-tome
Advanced tools
Readme
A simple tool for storing secrets.
This is under development and has not been audited yet. Currently uses the WebCrypto API, so it only works in modern browsers.
These are the cryptograph flows used by AncientTome:
init: salt + password --(bcrypt)--> hash --(AES-GCM)--> AES key
init: salt + password --(bcrypt)--> hash --(HMAC+SHA256)--> HMAC key
obfuscate keys: plainText --(HMAC+SHA256)--> cypherText
encrypt values: plainText --(AES-GCM)--> cypherText
The salt is randomly generated on first use and stored in plaintext. The password is provided by the user and stored in their head.
If you want to use localStorage
a wrapper is provided for you.
While localStorage
is synchronous, encryption is asynchronous,
so read methods require a callback.
Write methods have an optional callback called on completion.
var AncientLocal = require('ancient-tome/local')
var secureLocalStorage = AncientLocal()
secureLocalStorage.open(password, function(error) {
secureLocalStorage.setItem('journal', 'dear diary...', function(err){ ... })
secureLocalStorage.getItem('bank info', function(err, plaintext){ ... })
})
You can use whatever key-value storage mechanism you want. Reading non-existant keys should return a falsy value, not error. The first argument of callbacks should be the error or a falsy value. Here is a custom storage example:
var AncientTome = require('ancient-tome')
var myTome = AncientTome()
myTome._get = function(key, cb){ ... }
myTome._set = function(key, value, cb){ ... }
myTome._remove = function(key, cb){ ... }
With obfuscated keys, its hard to keep track of what's been stored.
Use the TomeIndexer
to augment a tome with a simple index.
Be sure to do this after if you are overriding get/set methods.
var AncientTome = require('ancient-tome')
var TomeIndexer = require('ancient-tome/indexer')
var myTome = AncientTome()
TomeIndexer(myTome)
myTome.open(password, function(){
myTome.index() //=> ['journal', 'bank info']
})
FAQs
A simple tool for storing secrets.
The npm package ancient-tome receives a total of 0 weekly downloads. As such, ancient-tome popularity was classified as not popular.
We found that ancient-tome demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.