Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Encode/Encrypt text message #37

Closed
wake-0 opened this issue Jan 22, 2020 · 4 comments
Closed

Encode/Encrypt text message #37

wake-0 opened this issue Jan 22, 2020 · 4 comments

Comments

@wake-0
Copy link

wake-0 commented Jan 22, 2020

Hello everybody,

I wanted to encrypt a text message with PySEAL and then decrypt it. Now I noticed that there is no Encoder that uses a string as input for encoding a Plaintext object.

Is there a suitable solution for this e.g. has someone implemented an own StringEncoder?

@Arman001
Copy link

Arman001 commented Feb 20, 2020

I don't think there is a StringEncoder for pyseal yet. I am currently just converting string to bits and then encrypting it with simple IntegerEncoder and it works fine. If there is another way then kindly inform me.

@wake-0
Copy link
Author

wake-0 commented Feb 24, 2020

@Arman001 what kind of encoding do you use for converting a string to int? Do you have any example code?

Thanks in advance!

@Arman001
Copy link

@Blackjack92 may be it is naive approach but you have to convert first string to bits like below
image
then you can convert resulting list into a numpy array and can do bit by bit encryption and then during decryption you will get bits and you can convert back to a string using
image
I hope it helps.

@wake-0
Copy link
Author

wake-0 commented Jun 25, 2020

@Arman001 Thank you very much for the code snippets!

@wake-0 wake-0 closed this as completed Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants