|
|
@ -73,11 +73,10 @@ $(function () {
|
|
|
|
|
|
|
|
|
|
|
|
var keyContent = text.substring(keyStartOffset, keyEndOffset);
|
|
|
|
var keyContent = text.substring(keyStartOffset, keyEndOffset);
|
|
|
|
|
|
|
|
|
|
|
|
var decryptedKey = 'DECRYPTED_KEY';
|
|
|
|
var decryptedPrivateKey = forge.pki.decryptRsaPrivateKey(keyContent.trim(), keyPassword);
|
|
|
|
|
|
|
|
var decryptedPem = forge.pki.privateKeyToPem(decryptedPrivateKey);
|
|
|
|
|
|
|
|
|
|
|
|
// actual decryption happens here
|
|
|
|
return text.substring(0, keyStartOffset) + decryptedPem + text.substring(keyEndOffset);
|
|
|
|
|
|
|
|
|
|
|
|
return text.substring(0, keyStartOffset) + decryptedKey + text.substring(keyEndOffset);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function saveText(text, fileName) {
|
|
|
|
function saveText(text, fileName) {
|
|
|
|