Browse Source

이머전시 툴 기능 추가

Surplus_Up (2DU) 7 years ago
parent
commit
8a35f75093
1 changed files with 7 additions and 2 deletions
  1. 7 2
      emergency_tool.py

+ 7 - 2
emergency_tool.py

@@ -1,6 +1,7 @@
 import json
 import sqlite3
 import bcrypt
+import hashlib
 import threading
 
 from func import *
@@ -69,7 +70,8 @@ elif what_i_do == '5':
 
     curs.execute("update other set data = ? where name = 'skin'", [skin])
 elif what_i_do == '6':
-    print('1. bcrypt')
+    print('1. sha256')
+    print('2. bcrypt')
     print('select : ', end = '')
     what_i_do = input()
 
@@ -80,8 +82,11 @@ elif what_i_do == '6':
     user_pw = input()
 
     if what_i_do == '1':
+        hashed = hashlib.sha256(bytes(user_pw, 'utf-8')).hexdigest()
+    elif what_i_do == '2':
         hashed = bcrypt.hashpw(bytes(user_pw, 'utf-8'), bcrypt.gensalt()).decode()
-        curs.execute("update user set pw = ? where id = ?", [hashed, user_name])
+       
+    curs.execute("update user set pw = ? where id = ?", [hashed, user_name])
 
 conn.commit()