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
encrypt cookies #9
Comments
Meh I don't think it's really necessary. Makes it a little harder to debug. and at that point you might as well use a session store if you want to hide details from the user |
Another module I will make then ;) security requirements are different for
|
Can this be done via an option? |
i asked @jed if he wants to move his stuff here. i'm not sure if i do this in this repo, but in koa's session, i began base64 encoding the entire session anyways to avoid issues with cookies with |
Re @defunctzombie: I would rather not have 2 libs for virtually the same thing. |
I agree. I would prefer to stop using my older yummy module in favor of
|
FYI, I kind of hacked encryption onto this package. Let me know if you want me to clean up, test and merge my fork: https://github.com/civitaslearning/cookie-session. |
@nburoojy Can your encryption implementation be merged back into cookie-session? |
@coen-hyde he said it was a fork so it should be possible... |
Mozilla has a package which does just this: mozilla/node-client-sessions |
Hi @sankethkatta , yep, and it's a 100% valid alternative! |
I was also looking for this option and didn't find anything. I made a super-easy to use express middleware to achieve transparently cookie encryption / decryption: cookie-encrypter. var app = express();
app.use(cookieParser(secretKey));
app.use(cookieEncrypter(secretKey)); Hope this helps |
@ebourmalo did you get it working with cookie-session? It seems the session cookies were not caught by the middleware. |
So apparently having stale issues is a sign of bad modules these days, who knew. This is still a desired feature that I plan to work on at some point, though anyone is welcome to make a PR as well. I'm going to close this issue, unfortunately, as just having it open down ranks the module. |
@dougwilson Just confirming I'm not overlooking something: encryption support hasn't been added to |
It has not been added and as noted above I'm not going to reopen the issue, either, for those reasons. If you want to see it happen, the best thing to do is to put to together a pull request instead of us keeping an issue open indefinitely. Perhaps if someone committed to having a pull request made in a specific timeline I can open this issue. If you want to make that commitment, let me know and I can reopen. |
@dougwilson |
* use nodes crypto library * encrypt the session after serialisation * test the correct implementation * closes expressjs#9
@dougwilson my PR for this feature is ready. Please have a look. |
* use nodes crypto library * encrypt the session after serialisation * initialisation vectors are prepended to the encrypted session * encryption key rotation is implemented * add the current node version to ci configuration * test the correct implementation * closes expressjs#9
Signing is nice, but a better thing might be to just encrypt the cookies outright. This serves the purpose of signing and also hiding the session details from user inspection.
The text was updated successfully, but these errors were encountered: