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

What are s1 and s2 for? #5

Open
dko-slapdash opened this issue Aug 1, 2020 · 3 comments
Open

What are s1 and s2 for? #5

dko-slapdash opened this issue Aug 1, 2020 · 3 comments

Comments

@dko-slapdash
Copy link

dko-slapdash commented Aug 1, 2020

I mean, I see in the code how are they used, and also see the algorithm in Wikipedia. I wonder though, why may we need s1 and s2 being non-null, what benefit does their presence carry?..

It looks like in some cases (e.g. when the encrypted message is not sent over the wire to someone, but instead is stored locally and is encrypted just for privacy/security reasons), making s1+s2 process optional (and removing the tag suffix from the message) may free up some CPU resources.

@bin-y
Copy link
Owner

bin-y commented Aug 2, 2020

Yes, lots of performance optimizations could be made to current implementation. I was just trying to make the code simple because I believe the performance cost of those parts would be very small compared to ecdh calculations. What is your use case? Is that very performance-critical?

@dko-slapdash
Copy link
Author

My usecase is encryption of the users’ data before writing it to some storage. The ciphertext is not transmitted over a public network, so there is no need for authentication.

@bin-y
Copy link
Owner

bin-y commented Aug 2, 2020

What about doing encryption on client side or simply using a symmetric block cipher? The first choice resulting an end-to-end encryption and the second one is better than ecies for streaming and reading from random offsets.

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