Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zarmack/fast-srp
Pure NodeJS SRP implementation
https://github.com/zarmack/fast-srp
Last synced: 3 months ago
JSON representation
Pure NodeJS SRP implementation
- Host: GitHub
- URL: https://github.com/zarmack/fast-srp
- Owner: zarmack
- License: mit
- Created: 2015-09-07T13:27:31.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-10T10:03:44.000Z (about 9 years ago)
- Last Synced: 2024-07-03T05:15:34.172Z (4 months ago)
- Language: JavaScript
- Size: 195 KB
- Stars: 8
- Watchers: 2
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fast-srp
Is a pure [NodeJS](https://nodejs.org/) implementation of the [SRP6a protocol](http://srp.stanford.edu/).
It's a derived work of [Jed Parson](http://jedparsons.com/)'s [node-srp](https://github.com/jedp/node-srp) and [Tom Wu](http://www-cs-students.stanford.edu/~tjw/)'s [jsbn](http://www-cs-students.stanford.edu/~tjw/jsbn/).
## Creating the Verifier
```javascript
'use strict';var srp6a = require('fast-srp');
/**
* Computes the verifier of a user. Only needed to add the user to the auth system.
*
* I: (string) Username to compute verifier
* P: (string) Password
* callback: (function) Callback function with two params; error, verifier
*
* returns: verifier (Buffer)
*
*/var srp6a_create_user = function(I, P, callback) {
srp6a.genKey(32, function(error, salt) {
if(error) {
callback(error);
}
var v = srp6a.computeVerifier(srp6a.params[4096], salt, new Buffer(I), new Buffer(P));
callback(null, v);
});
}srp6a_create_user('Zarmack Tanen', '*****', function(error, verifier) {
if(error)
throw error;
console.log("SRP6a verifier of Zarmack Tanen user is " + verifier.toString('hex'));
});
```