Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
354 views
in CompleteFTP by (350 points)
I can decrypt/encrypt files via the CLI with the '(de)encrypt -s <source path> -d <destination path>'

works fine,

However, I have not been able to call it from a custom server side javascript command.

Is this possible?

Also, if I was to encrypt a file on one FTP server, would I be able to decrypt it from another one? Or is there a salt applied during installation

On a related note:

Are there any plans on changing the base64 encoder/decoder libraries included to handle anything other than ascii/unicode?

Use case here is to store user passwords as base64 encoded encrypted strings in a JSON database. Transfer the JSON files to different servers and onboard the users programatically via a combination of server side javascript and SSH commands.

1 Answer

0 votes
by (350 points)
var arg1 = [ '-s', tempFileName, '-d', encFileName];
system.executeCustomCommand('encrypt', arg1 );

So, I have figured out the encryption/decryption mechanism.
Still have queries regarding the built-in base64 encoders (especially with binary/encrypted content) and whether a salt is applied
by (350 points)
So, Binary files can be encoded with this snippet:

var encByteArray = System.IO.ReadAllBytes(windowsFilePath)
var b64String = System.Convert.ToBase64String(encByteArray)

Categories

...