xorbit / node-aes-gcm Goto Github PK
View Code? Open in Web Editor NEWAES GCM module for node.js using OpenSSL
License: MIT License
AES GCM module for node.js using OpenSSL
License: MIT License
I'm calling the encrypt method with:
Key: "type":"Buffer","data":[168,125,71,167,119,186,91,241,119,19,122,146,63,102,224,53]}
IV: {"type":"Buffer","data":[250,231,95,142,111,77,143,87,2,2,215,153]}
Plaintext: {"type":"Buffer","data":[0,0,133,233,101]}
AAD: {"type":"Buffer","data":[]}
With node 0.11, 0.12 and 4 the result is
hQFe6BBk3QBHMHbS8lMxmIjeidmW
With node 0.10.44 the result is
4-QRsR3EBk7p9yEbysMLk29M8i8C
I don't understand why there is a difference here, any pointers?
Hi,
I'm not a C++ developer, nor a Windows user, so unfortunately I'm not able to debug this myself. The build works like magic on Linux.
Firstly I received an error stating it couldn't find OpenSSL -- simple enough to fix. I did have to use Visual Studio 2010 to get to the point where the error wouldn't show as I needed to include the OpenSSL library which Windows couldn't find.
I then received the following error:
..\src\node-aes-gcm.cc(213): error C2440: 'initializing' : cannot convert from 'overloaded-function' to 'void (__cdecl *)(v8::Handle<T>)'
And this is where I cannot proceed.
Other information:
OS: Windows 7 64bit
node-aes-gcm: 0.1.3
I'm using node-webkit and nw-gyp build
to build. (This shouldn't be related to the problem)
Any help/pointers would be appreciated.
Any plans on supporting Node v0.11?
I am making my application using Ionic 2.0.0-beta.4
and trying to using node-aes-gcm for encryption.
I have installed it and ran node-gyp rebuild
to get the build file and node_aes_gcm.node
.
However when I build it on Ionic, it gives me a syntax error:
SyntaxError: Unexpected character 'SyntaxError: Unexpected character '�' (2:2) while parsing C:\Users\JK\Desktop\MyIonic2Project\MyIonic2ProjectTest\node_modules\node-aes-gcm\build\Release\node_aes_gcm.node while parsing file: C:\Users\JK\Desktop\MyIonic2Project\MyIonic2ProjectTest\node_modules\node-aes-gcm\build\Release\node_aes_gcm.node
Any suggestions to make it run on Ionic?
While building on Windows 10, was having trouble building this package because of the requirement of the OpenSSL library (make sure to use the full package, NOT the light one). Once I realized that it needed to be installed, I saw that the latest version of OpenSSL 64-bit uses a different path by default than the build is expecting.
After instructing the installer to put OpenSSL files in C:\OpenSSL-Win64\
(instead of the default directory which I believe is C:\Program Files\OpenSSL-Win64\
), the package installed correctly. Isn't there a better way to find the path that is more dynamic on the installation system?
Here is the output I was getting on trying to build without OpenSSL installed:
C:\WINDOWS\system32>npm install -g node-aes-gcm
\
> [email protected] install C:\Users\eliot\AppData\Roaming\npm\node_modules\node-aes-gcm
> node-gyp rebuild
C:\Users\eliot\AppData\Roaming\npm\node_modules\node-aes-gcm>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
node-aes-gcm.cc
win_delay_load_hook.cc
..\src\node-aes-gcm.cc(76): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [C:\Use
rs\eliot\AppData\Roaming\npm\node_modules\node-aes-gcm\build\node_aes_gcm.vcxproj]
..\src\node-aes-gcm.cc(80): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [C:\Use
rs\eliot\AppData\Roaming\npm\node_modules\node-aes-gcm\build\node_aes_gcm.vcxproj]
..\src\node-aes-gcm.cc(91): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data [C
:\Users\eliot\AppData\Roaming\npm\node_modules\node-aes-gcm\build\node_aes_gcm.vcxproj]
..\src\node-aes-gcm.cc(150): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [C:\Us
ers\eliot\AppData\Roaming\npm\node_modules\node-aes-gcm\build\node_aes_gcm.vcxproj]
..\src\node-aes-gcm.cc(155): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [C:\Us
ers\eliot\AppData\Roaming\npm\node_modules\node-aes-gcm\build\node_aes_gcm.vcxproj]
..\src\node-aes-gcm.cc(164): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data [
C:\Users\eliot\AppData\Roaming\npm\node_modules\node-aes-gcm\build\node_aes_gcm.vcxproj]
LINK : fatal error LNK1181: cannot open input file 'C:\OpenSSL-Win64\lib\libeay32.lib' [C:\Users\eliot\AppData\
Roaming\npm\node_modules\node-aes-gcm\build\node_aes_gcm.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\eliot\AppData\Roaming\npm\node_modules\node-aes-gcm
gyp ERR! node -v v4.5.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "node-aes-gcm"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-aes-gcm package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-aes-gcm
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls node-aes-gcm
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\WINDOWS\system32\npm-debug.log
C:\WINDOWS\system32>
npm install node-aes-gcm error. node v14.16.0 Windows 10 OpenSSL 1.1.1h
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.