瀏覽代碼

hashing is comlete

Orlando04 2 年之前
父節點
當前提交
3f6c4a33c7
共有 1 個檔案被更改,包括 4 行新增4 行删除
  1. 4
    4
      MocionesIUPI/screens/MocionScreen.js

+ 4
- 4
MocionesIUPI/screens/MocionScreen.js 查看文件

@@ -38,12 +38,12 @@ export default App = ({ navigation }) => {
38 38
 
39 39
      // this is for encrypting the message
40 40
     var CryptoJS = require('crypto-js');
41
-    const privKey = "MOCIONES_IUPI";
41
+    const privKey = "Zr4u7x!z%C*F-JaN";
42 42
 
43
-    const Token = CryptoJS.AES.encrypt(message,privKey);
44
-    const privKey_encrypt = CryptoJS.AES.encrypt(privKey, privKey); 
43
+    const Token = CryptoJS.SHA256(message);
44
+    const privKey_encrypt = CryptoJS.SHA256(privKey); 
45 45
 
46
-    const url = `http://10.190.1.140:5000/vote?PIN=${PIN}&Token=${Token}&votos=${votos}&privKey_encrypt=${privKey_encrypt}`;
46
+    const url = `http://10.190.1.140:5000/vote?PIN=${PIN}&Token=${Token.toString()}&votos=${votos}&privKey_encrypt=${privKey_encrypt.toString()}`;
47 47
 
48 48
     //connecting to API
49 49
     fetch(url);