NYCU CS LA Course final project
$ git clone https://github.com/SiriusKoan/NYCU-LA-final-project.git
$ cd NYCU-LA-final-project
$ pipenv shell
$ pipenv install
$ exit
$ pipenv run python3 PicrypterBOT.py
This telegram bot is devised to help people encrypt and decrypt confidential photos with user-specified passwords, through linear algebra techniques.
/start : Show greeting and the customized keyboard.
/end : Clear data.
/encrypt : Encrypt the image with the password.
/dncrypt : Decrypt the image with the password.
Text Message : Store as the password.
Image File Message : Store as an image file.
-
Type in
/startto get the customized keyboard. -
Press the
/imagebutton and send the image file.Note: Remember to press
Send as Fileand DO NOT check compression. -
Press the
/passwordbutton and enter the password. -
Press the
/encrypt/decryptbutton and wait for a response.-
Warning! Fail to encrypt!This warning arises when you haven not entered the password or send the image file. Please make sure previous steps are finished.
-
Wait a moment...Your image is being encrypted or decrypted now!
Wait about 5 ~ 10 seconds, the bot will send back the encrypted / decrypted image.
Note: If there is no response for a too long period of time, Time Out may have occurred due to some server error or the file size is overwhelming. Please do step 2 to 4 again or try another smaller image .
Note: Should your image be too large, you can compress it via telegram first (send it to someone with compression checked). Yet remember NOT to check compression while sending your image to the bot!
-
-
Get the Image File!
-
Type in
/endto clear your data.
-
Expand user-specified password into a long key by a large, random generated matrix (6000 by 100).
-
The key is then divided into several vectors, with each vector comprising 10 entries, acting as columns for a new matrix A.
-
Each vector of the key will undergo check of linear independence, from the beginning: If the current vector is linearly independent with all the preceding vectors, it will be added into A, otherwise discarded.
-
A has been constructed!
-
Compute E = A^T A, where E is invertible for A has linearly independent columns!
-
E is then used to encrypt and decrypt images ! (E depends on user-specified password.)
-
For more details, please refer to technique_specifics.pdf.