-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a bin file to enable command-line decryption #3
Conversation
@@ -21,6 +21,7 @@ | |||
"github": "https://github.com/bcasey" | |||
} | |||
], | |||
"bin": "./bin/index.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this file be compiled with babel on publish?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only runs on node
which supports all the features it utilizes. I'm not sure how useful it is to support a version of node older than 4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh. This will not run the webcrypto branch, which we've been having trouble with, and this is only for one segment at a time, but, 'as you wish'.
} | ||
|
||
let keyContent = opt; | ||
let ints = keyContent.match(/^0?x?(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})/i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not jazzed about these regexes...
} else { | ||
ivContent = opt; | ||
} | ||
let ints = ivContent.match(/^0?x?(.{8})(.{8})(.{8})(.{8})/i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah not jazzed about regexing these uint32's out...
function(err, decryptedBytes) { | ||
// err always null | ||
if (!err) { | ||
let data = new Buffer(decryptedBytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm paranoid about this. Can we cast to hex or base64 or a string representation, or add an option for that?
A simple utility for decryption of AES encrypted files.