Update encryptor.js

This commit is contained in:
Namhyeon Go 2024-03-19 17:59:34 +09:00
parent 4c88348ddf
commit e0df993bad

View File

@ -12,11 +12,18 @@ function main(args) {
return 0;
}
var dstfile = filename + ".enc";
if (FILE.fileExists(dstfile)) {
console.error(dstfile, "already exists. Please delete it.");
return 0;
}
var filename = args[0];
var userKey = '';
while (userKey.length == 0 || userKey.length > 16) {
userKey = Toolkit.prompt("Please enter the password for encryption:");
}
var data = FILE.readFile(filename, FILE.CdoCharset.CdoUTF_8);
var encryptedData = Toolkit.encryptStringHIGHT(userKey, data);