Browse Source

hashing is comlete

Orlando04 2 years ago
parent
commit
3f6c4a33c7
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      MocionesIUPI/screens/MocionScreen.js

+ 4
- 4
MocionesIUPI/screens/MocionScreen.js View File

38
 
38
 
39
      // this is for encrypting the message
39
      // this is for encrypting the message
40
     var CryptoJS = require('crypto-js');
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
     //connecting to API
48
     //connecting to API
49
     fetch(url);
49
     fetch(url);