Actually use SHA512, not 256

This commit is contained in:
Julia Friesel
2018-09-13 16:52:54 +02:00
parent 34648a3d89
commit f2f0278a1c
2 changed files with 6 additions and 5 deletions
+5 -3
View File
@@ -26,9 +26,11 @@ export default class PasswordPrompt extends Component {
async msg => {
msg = JSON.parse(msg)
if (msg.type === 'sha512') {
const key = new Int8Array(64)
for (let i = 0; i < msg.message.length; i++) {
key[i] = msg.message.charCodeAt(i)
const hash = msg.message
const key = new Uint8Array(64)
for (let i = 0; i < key.length; i++) {
const twoDigitHex = hash.slice(i * 2, i * 2 + 2)
key[i] = parseInt(twoDigitHex, 16)
}
try {
await openDbConnection(key)