Skip to content
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

Merged
merged 4 commits into from
Jan 10, 2017
Merged

Conversation

imbcmdth
Copy link
Member

A simple utility for decryption of AES encrypted files.

@@ -21,6 +21,7 @@
"github": "https://github.com/bcasey"
}
],
"bin": "./bin/index.js",
Copy link
Member

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?

Copy link
Member Author

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.

@dconnolly dconnolly changed the title Add a bin file to enable comamnd-line decryption Jan 9, 2017
@imbcmdth imbcmdth merged commit 3b5efa9 into master Jan 10, 2017
Copy link
Contributor

@dconnolly dconnolly left a 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);
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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?

@gkatsev gkatsev deleted the command-line branch November 3, 2020 16:10
@gkatsev gkatsev restored the command-line branch November 3, 2020 16:10
@gkatsev gkatsev deleted the command-line branch November 3, 2020 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants