Send/receive Encrypt/Decrypt Local File

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
jeisen
Posts: 12
Joined: Sat 14 Feb 2015 20:15

Send/receive Encrypt/Decrypt Local File

Post by jeisen » Fri 27 Feb 2015 23:03

We need to encrypt data at rest. So, when uploading using SFTP is there an event to capture the local file to decrypt before sending and likewise I was hoping to use oncreatelocalfile on the download to encrypt the local file before saving. Thank you

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Send/receive Encrypt/Decrypt Local File

Post by ViktorV » Fri 06 Mar 2015 09:43

To decrypt data of a local file and load the decrypted file to the server, you can use the following algorithm:
1. Create a remote file using the TScSFTPClient.OpenFile method.
2. Read data from the local file and decrypt it.
3. Write decrypted data to the remote file using the TScSFTPClient.WriteFile method.
4. Close the remote file using the TScSFTPClient.CloseHandle method.

To encrypt data of the remote file and write encrypted data to a local file, you can use the following algorithm:
1. Open the remote file using the TScSFTPClient.OpenFile method.
2. Read data from the remote file using the TScSFTPClient.ReadFile method.
3. Encrypt data and write it to a local file.
4. Close the remote file using the TScSFTPClient.CloseHandle method.

Post Reply