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

Encryption/Decryption Method #14

Open
Roycohen opened this issue Jan 22, 2017 · 4 comments
Open

Encryption/Decryption Method #14

Roycohen opened this issue Jan 22, 2017 · 4 comments

Comments

@Roycohen
Copy link

Hi There,

Assume I want to use this library and to decrypt and encrypt more things in PHP.
How can I achieve it?

What is the encryption method?
Do you have any PHP code example or can you please assist me in building one, using mcrypt or something.

Thanks

@agentzh
Copy link
Member

agentzh commented Jan 22, 2017

@Roycohen The simplest way is just to write a simple PHP C extension library including the core C functions for encryption/decryption in this nginx C module.

@siberex
Copy link

siberex commented Jan 23, 2017

@Roycohen use this snippet: https://gist.github.com/siberex/ee135b2d28b3b4be77c5

This is a php code to encrypt and decrypt data in encrypted-session-nginx-module compatible way. So, you can encrypt with php and decrypt with nginx module, and vice versa.

@naviocean
Copy link

Hello @siberex,
Do you have Nodejs code?

@siberex
Copy link

siberex commented Jun 20, 2017

@naviocean I don't have one. But you can easily transcribe it from php using either native NodeJS Crypto module or mcrypt npm package.
Just keep in mind that nginx module does not use "true" HMAC, but simple md5 of message instead (see comments in my gist).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants