added decrypt

master
cheetah 2 years ago
parent 67dae1bece
commit 6a1a81b25b

@ -38,7 +38,6 @@ class BOSkrypt {
.substring(0, 7) //take first 7 chars .substring(0, 7) //take first 7 chars
}).join('') //join to one complete string }).join('') //join to one complete string
console.log('compressedPreparedPayload', compressedPreparedPayload)
let compressedPayload = [] let compressedPayload = []
for (let i=0;i<compressedPreparedPayload.length;i+=8) { for (let i=0;i<compressedPreparedPayload.length;i+=8) {
let byte = parseInt( let byte = parseInt(
@ -51,8 +50,6 @@ class BOSkrypt {
compressedPayload.push( byte ) //put in array compressedPayload.push( byte ) //put in array
} }
compressedPayload = Buffer.from(compressedPayload) compressedPayload = Buffer.from(compressedPayload)
console.log('compressedPayload', compressedPayload)
console.log('uncPayloadHash', uncPayloadHash.length, uncPayloadHash)
const toEncryptData = Buffer.concat([ const toEncryptData = Buffer.concat([
uncPayloadHash, compressedPayload uncPayloadHash, compressedPayload
]) ])
@ -60,7 +57,6 @@ class BOSkrypt {
const encrpytedIncludingIVandSHA1Checksum = Buffer.concat([ const encrpytedIncludingIVandSHA1Checksum = Buffer.concat([
ivWithTimestamp, encryptedPayload ivWithTimestamp, encryptedPayload
]) ])
console.log('ivWithTimestamp', ivWithTimestamp)
return encrpytedIncludingIVandSHA1Checksum.toString('base64') return encrpytedIncludingIVandSHA1Checksum.toString('base64')
} }
decrypt(encrpytedIncludingIVandSHA1Checksum, key) { decrypt(encrpytedIncludingIVandSHA1Checksum, key) {

Loading…
Cancel
Save