akshgpt7 / MarvellOS

A basic operating system GUI mock-up built using python's GUI module Tkinter.
20 stars 20 forks source link

Use binary mode text file to store password #3

Closed akshgpt7 closed 4 years ago

akshgpt7 commented 4 years ago

Currently, the password is stored as plain text. Using a binary mode to store will make it safer.

sharonMandel commented 4 years ago

Do you mean encrypt text to binary?

akshgpt7 commented 4 years ago

Yes, open the password.txt file in write binary mode and then write it. Also, make sure it is checked correctly when user enters a password.

sharonMandel commented 4 years ago

If I understand correct:

  1. open text file and read the content (which is password).
  2. write the password in binary mode to the text file.
  3. compare the password from the screen [not sure what you meant about this part] to the one which is saved in the file [in step 2]? Is this correct?
akshgpt7 commented 4 years ago

Yes, that is what is needed. Basically, the current problem is that the password is visible in the text file. If it is stored in binary encrypted form, it'll not be that obvious to look at. So, rather than opening the file in w mode, use wb mode when someone changes the password. Similarly, rb mode for reading.

MercerFrey commented 4 years ago

Hello, I want to contribute. Is it fine to encode password to base64?

akshgpt7 commented 4 years ago

Yes, that would do. Go ahead!

akshgpt7 commented 4 years ago

Fixed by #8