Comments (14)
Makes sense publishing this on bower but why on npm? This package is not intended nor designed for node (and moreover node has access to openssl so there is really no need for a package like this)
from jsencrypt.
Some people use npm + browserify for front-end development. Also, if you don't do it, someone else will.
from jsencrypt.
Well, I think that the bower publication can be made immediately (of course @travist should do this), for npm I'd like to check that everything works fine when included using npm (+ browserify as you suggest) before publishing there.
from jsencrypt.
I strongly suggest using the UMD wrapper to cover all your AMD / CommonJS / global bases:
from jsencrypt.
I have also been wanting to add Grunt tools instead of a make file, so I do have plans to work on this (at least for npm with a package.json), but I just have not had a chance to get the changes in place. If anyone is willing to submit a pull request with this, I would be very grateful and then will gladly push it up to my NPM account.
from jsencrypt.
+1 for npm, no modules like this available but we need them. Running command-line commands in NodeJS is not what I would recommend. When using the openssl
command you you have to do it in 2 steps where a private key must be saved into a file. Well... this is not strait forward when you have a nodejs cluster. I hope this project will go on, I really like it.
from jsencrypt.
Of course running openssl from inside nodejs would not be ideal but other modules (like the nodejs builtin crypto module) would do a better job without any doubt. The fact is that this implementation is meant for browser, not for server where the computational power would not be used as it should. Anyway if you feel that an API similar to this could be useful we could develop a specific branch for node JS compatibility keeping the public API untouched while using the crypto module underneath
from jsencrypt.
Quite a few people use node and npm for their front-end build process, libraries such as Browserify expose node modules to the client and having libraries available through npm really streamlines this process. While it's absolutely true that developers likely wouldn't benefit from using a library such as this one on the server side, it makes dependency management a breeze.
from jsencrypt.
When I first created this issue on Dec 2, 2013, I was mainly using Bower. Now, most of my colleagues and I have abandoned bower for npm & Browserify.
from jsencrypt.
Well for me is okay and I could publish it on npm, but I'm out of time sadly due to work. Before I publish it can anybody test that everything works well when included through browserify? Again sorry if I didn't on my own but has been a very busy summer and seems is not going to end yet :S
from jsencrypt.
Ok, just pushed it up to NPM. https://www.npmjs.org/package/jsencrypt
Let me know if this works or if we need to modify it.
from jsencrypt.
@travist There are a couple of things that need to be changed to make it work with node.
- You need to add the
main
attribute to yourpackage.json
:
{
// ...
"main": "bin/jsencrypt.js"
}
- You're accessing the
navigator
object in JSEncrypt which does not exist in node. You'll need to check whether the object is available. If not, treat it like it's a Chrome browser (both Node.js and Chrome use the V8 engine)
from jsencrypt.
+1 for comment by @saschagehlich on main
attribute
from jsencrypt.
Yea can this change be made? It was recommended a few months ago and I've spent some time trying to figure out why it wasn't working.
from jsencrypt.
Related Issues (20)
- Decrypted result has wrong encoding HOT 1
- window is not defined in nuxtjs v3 HOT 8
- Suggest to add judgment when string too long
- Front-end performed RSA signature on the HMAC using SHA256, but the length was incorrect, causing the server to fail to verify it. HOT 1
- CVE-2012-5883
- An error occurred when using jsencrypt in a lower version of Chrome
- encryption returning false HOT 3
- Support node.js ? ReferenceError: window is not defined HOT 6
- Problem after upgrade to latest version from 3.2.1 on verify method
- Why is the result of each encryption different from the same content?
- [REQUEST] remove browser dependency ?
- Can the ciphertext length of JSENCRYPT 3.3.2 be controlled
- nest.js jsencrypt does not work with error `window is not defined`
- Content-Security-Policy blocked jsencryt.min.js file version 3.0.0-rc.2
- Need a fix for CVE-2023-46809 HOT 3
- Problem to decrypt in NodeJs with crypto HOT 1
- How should Java verify your generated signature HOT 1
- How to decrypt Blob、ArrayBuffer ?
- yahoo.js文件中的yui代码存在安全漏洞,是否使用最新版本的代码 HOT 4
- @3.3.2 linux public Rollup failed to resolve import HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsencrypt.