Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diewland/secure-file-storage
Load/Save data from encrypted file
https://github.com/diewland/secure-file-storage
file-storage secure-files
Last synced: 1 day ago
JSON representation
Load/Save data from encrypted file
- Host: GitHub
- URL: https://github.com/diewland/secure-file-storage
- Owner: diewland
- License: mit
- Created: 2019-09-26T03:49:41.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-08T00:44:04.000Z (almost 2 years ago)
- Last Synced: 2023-02-28T17:40:37.364Z (over 1 year ago)
- Topics: file-storage, secure-files
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# secure-file-storage
Example
``` python
from pprint import pprint as ppkey_path = './secret.key'
out_path = './out'# input
in_obj = {
'boolean1': True,
'boolean2': False,
'int': 1234567890,
'float': 12345.6789,
'list': [
'ไทย',
'English',
'日本語',
],
'tuple': (
12345,
6.789,
True,
False,
),
}
print('\n----- input -----\n')
pp(in_obj)# gen key -- first time only
#sfs = SecureFileStorage()
#sfs.gen_key(key_path)sfs = SecureFileStorage(key_path)
# save data
sfs.save(in_obj, out_path)# load data
out_obj = sfs.load(out_path)# print output
print('\n----- output -----\n')
pp(out_obj)
```Output
```
----- input -----{'boolean1': True,
'boolean2': False,
'float': 12345.6789,
'int': 1234567890,
'list': ['ไทย', 'English', '日本語'],
'tuple': (12345, 6.789, True, False)}----- output -----
{'boolean1': True,
'boolean2': False,
'float': 12345.6789,
'int': 1234567890,
'list': ['ไทย', 'English', '日本語'],
'tuple': [12345, 6.789, True, False]}
```