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

README shows different results from actual #5

Open
ggriffin opened this issue Feb 6, 2020 · 1 comment
Open

README shows different results from actual #5

ggriffin opened this issue Feb 6, 2020 · 1 comment

Comments

@ggriffin
Copy link

ggriffin commented Feb 6, 2020

Should I expect to get the same encrypted result as what is shown in the README?
I get 5011 instead of 4984:

$ node
Welcome to Node.js v12.14.1.
> const fe1 = require('node-fe1-fpe');
> const v = fe1.encrypt(10001, 1, 'my-secret-key', 'my-non-secret-tweak');
> console.log(v)
5011
> const d = fe1.decrypt(10001, v, 'my-secret-key', 'my-non-secret-tweak');
> console.log(d);
1

// curious what 4984 decrypts to:
> const d2 = fe1.decrypt(10001, 4984, 'my-secret-key', 'my-non-secret-tweak');
> console.log(d2);
6786
@nanov
Copy link
Member

nanov commented Feb 15, 2020

Interesting, may be a mistake, anyways it seems to encrypt and decrypt as expected.
Could you test it with buffer exactly as in the readme and if the case is still so readme will be updated.

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

2 participants