Skip to content
This repository was archived by the owner on Feb 17, 2019. It is now read-only.

Commit eedc32d

Browse files
committed
add user credentials file and tool
1 parent b56ae12 commit eedc32d

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ See `scsync --help` for all options.
1717
### Server:
1818
`scsync [-s] [-p <port>] [-f <directory-path>]`
1919

20+
#### User Credentials
21+
For each user a password hash and salt have to be generated using the `tools/gen_user_vkey.py` script.
22+
23+
The credentials are then stored as CSV using the format `<username>,<salt>,<verification_key>` in the `users.csv`.
24+
2025
### Arguments:
2126
`-s` Server mode: accept incoming connections from any host
2227
`-p` Specify the port number (default: `5000`)

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
aiofiles>=0.3
2+
cryptography>=1.8
3+
srp>=1.0
24
watchdog>=0.8
35
pyrsync2>=0.2

tools/gen_user_vkey.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python3
2+
# coding: utf-8
3+
4+
import base64
5+
6+
import srp
7+
8+
9+
def main():
10+
username = input("Enter username: ")
11+
password = input("Enter password: ")
12+
salt, vkey = srp.create_salted_verification_key(username, password)
13+
14+
print()
15+
print("Add the following line to the users.csv:")
16+
print()
17+
print("%s,%s,%s" % (username, base64.b64encode(salt).decode(
18+
'utf-8'), base64.b64encode(vkey).decode('utf-8')))
19+
20+
if __name__ == "__main__":
21+
main()

users.csv

Whitespace-only changes.

0 commit comments

Comments
 (0)