-2

I'm using Python (3.7.4) to make a text/password manager, where the user can store text under different tabs (using tkinter for the interface) , and use a "master login" to access all data.

The only experience I've got with saving/storing data is using CSV files, and looping through them to get values.

Can anyone recommend anyway I can store text, without it being able to be opened from Windows Explorer, and need some sort of key to be opened?

martineau
  • 119,623
  • 25
  • 170
  • 301
duck
  • 9
  • 1
  • 1
    a sqlite database? the interface is in the standard library – gold_cy Sep 22 '19 at 14:02
  • Would it be possible to get more infomation on waht you are tring to do. – gerard Garvey Sep 22 '19 at 14:03
  • 1
    Firstly, have you looked into off the shelf solutions for this yet? You [probably shouldn't be writing this yourself](https://blog.1password.com/dont-trust-a-password-management-system-you-design-yourself/) if you want it to be secure. [Here](https://keepassx.readthedocs.io/en/latest/) are [some](https://pypi.org/project/pyvault/) links [you](https://www.mssqltips.com/sqlservertip/5173/encrypting-passwords-for-use-with-python-and-sql-server/) might find useful. Also take a look at this: https://codereview.stackexchange.com/questions/219400/python-password-manager – Dan Sep 22 '19 at 14:15
  • @Dan Im just doing this for a little project, 'just to get a bit better at python' as its put. Thanks for the heads up though :P – duck Sep 22 '19 at 15:06

2 Answers2

1

The natural alternative to using csv files is the use of a database. A solution like sqlite might be enough for your solution. Directly from the documentation:

SQLite is a C library that provides a lightweight disk-based database that doesn’t require a separate server process and allows accessing the database using a nonstandard variant of the SQL query language. Some applications can use SQLite for internal data storage. It’s also possible to prototype an application using SQLite and then port the code to a larger database such as PostgreSQL or Oracle.

Once you have learned sqlite, you can think of encrypting your database: in this post you will find many ideas for encrypting your sqlite database.

Otherwise you can switch to other more complete and complex DBMSs. The important thing is that you consider moving from the csv to using a db.

Massifox
  • 4,369
  • 11
  • 31
1

Take a look at SQLLite as a lightweight local database and use something like SQLCipher for strong AES 256-bit encryption.

I havn't read it fully but take a look at this blog for a python implementation.

Massifox
  • 4,369
  • 11
  • 31
Kareem
  • 569
  • 2
  • 18