Fixed a mistake on my part where output would be username:hash instead of hashing username:password as a whole
This commit is contained in:
7
app.py
7
app.py
@@ -57,7 +57,10 @@ def do_hash():
|
|||||||
abort(400, 'Please type your username.')
|
abort(400, 'Please type your username.')
|
||||||
|
|
||||||
specified_salt = 'LVZ1TJMdAIdLyBla6nWDexFt'
|
specified_salt = 'LVZ1TJMdAIdLyBla6nWDexFt'
|
||||||
b_pass = password.encode('utf-8')
|
|
||||||
|
full_block = f"{username}:{password}"
|
||||||
|
|
||||||
|
b_pass = full_block.encode('utf-8')
|
||||||
b_salt = specified_salt.encode('utf-8')
|
b_salt = specified_salt.encode('utf-8')
|
||||||
|
|
||||||
raw_hash_copyparty = hash_secret(
|
raw_hash_copyparty = hash_secret(
|
||||||
@@ -72,7 +75,7 @@ def do_hash():
|
|||||||
)
|
)
|
||||||
|
|
||||||
hash_only = raw_hash_copyparty.split(b"$")[-1].decode('utf-8')
|
hash_only = raw_hash_copyparty.split(b"$")[-1].decode('utf-8')
|
||||||
final_hash = username + ":+" + hash_only.replace('/', "_").replace('+', '-')
|
final_hash = "+" + hash_only.replace('/', "_").replace('+', '-')
|
||||||
|
|
||||||
return jsonify({'hash': final_hash})
|
return jsonify({'hash': final_hash})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user