Does winscp has checksum feature?

Previously when we transferred a 20GB gz  Solaris file down to PC's
local HDD & then from the local PC HDD, transfer to a USB HDD, our
DLP corrupted the gz file when it's transferred from local HDD to USB

We have since resolve that but to prevent untoward corruption in
future for copying of critical files to USB HDD,

Does Winscp has checksum feature that checks at Unix end & at
PC end?

If so I would rather use Winscp to transfer directly to USB HDD.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sunhuxAuthor Commented:
> If so I would rather use Winscp to transfer directly to USB HDD.
ie transfer from Unix server directly to USB HDD
ste5anSenior DeveloperCommented:
First of all: It's not about the specific client, it's about the used protocol.

Both SCP and SFTP (the preferred transfer protocol of WinSCP) does such checks to protect file integrity.

Same is for copying data to/over USB. Copying is integrity protected.

But: errors can happen on many levels. And in your case is seems that you need an additional level above the involved tools level. Thus you should run a checksum process on the server-side and create an explicit checksum file containing MD5/SHAx (chksum, md5sum, sha1sum/sha256sum). Then copy also this checksum file and test explicitly against this file after it was copied to that USB device.

btw, I would also test that USB device and the used cables. And use a different USB port on the client machine.
nociSoftware EngineerCommented:
TCP packets are protected with Checksums, (uderlying Ethernet, PPP etc. packets all have checksums)
Then also the SSH protocol has checksums.

File on USB would be equal to what is on the original, to verify files are not damaged/corrupeted they can be put into archives that have an additional checksum layer (zip, rar, tar, ...).  And an extra checksum can be calculated there are a lot of CRC/Checksum tools available.
MD5 is not too secure, as it is currently possible to generate Collisions to MD5 in short times. SHA1 is on the brink of being broken,esp. for long time storage. So try shaXsum X = 224, 256, 348, 512,   or b2sum.

WinSCP  when used to copy from system -> system it uses a SSh conenction to tunnel data through, when used for local copies no checksummof of data layers are taken (it is just a cp or copy ).
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

sunhuxAuthor Commented:
> It's not about the specific client, it's about the used protocol
Was told by my ex-colleagues in the bank that they had encountered
corruption when transferring using sftp or scp (betwn AS400 & Unix)
thus ConnectDirect was the preferred tool to do transfer as it has
checksumming specifically.

ConnectDirect will not save the file if the link is interrupted but would
sftp/scp save the file if transfer is interrupted?

One last question:
in Winscp, the "Transfer Settings" is usually set as "Default" : under
what circumstances will it use Binary or ASCII ?  My Unix ex-colleagues
had seen cases when it used Binary & sometimes Ascii for "Default"
nociSoftware EngineerCommented:
AS 400 stores file differently... from UNIX. WinSCP always uses binary.
so the corruption is a difference of opnion of fileformats.

unless FTP is used then ascii may be chosen... FTP publishes passwords though.

Checksumming tools will not help either as both ends of the connection have a different opnionion on what constirutes a valid file format.
sunhuxAuthor Commented:
The sftp file corruption with AS400 is not a matter of file format but  missing
lines/records.  We'll leave this aside.

Will take it that winscp has checksumming feature: it can even resume a
transfer from where it was last disrupted.

To close this thread, need an answer for one last question:

in Winscp, the "Transfer Settings" is usually set as "Default" : under
what circumstances will it use Binary or ASCII ?  My Unix ex-colleagues
had seen cases when it used Binary & sometimes Ascii for "Default"
nociSoftware EngineerCommented:
With: Binary bytes are transfered as is... blocks of bytes.
Ascii transfers will convert files in records ending in CR/LF during transfer.  (chr(13), chr(10))

On unix -> unix the difference is moot, to other systems it may be relevant.
On unix a text file is  any file which which uses LF character  (chr(10))  and and of line character.

FTP transfers (port 21) does know this difference. SCP transfers (port 22) don't have this difference.
Resume is not based on checksum, it asks the remote how long the file is and then starts sending
from that point on.
sunhuxAuthor Commented:
There are occasions the "Transfer Setting" of Default will use Ascii
& sometimes Binary   as encountered by my ex-colleagues.

So does Winscp detect by the extension of the file eg: .txt will auto
default to Ascii  while  .bin  or  .zip   or .gz will default to  Binary?
nociSoftware EngineerCommented:
The SCP/SFTP protocol has no concept of ascii/baniary  see:  ==> always does binary. Again no problem with unix-> unix transfers.

sftp> help
Available commands:
bye                                Quit sftp
cd path                            Change remote directory to 'path'
chgrp grp path                     Change group of file 'path' to 'grp'
chmod mode path                    Change permissions of file 'path' to 'mode'
chown own path                     Change owner of file 'path' to 'own'
df [-hi] [path]                    Display statistics for current directory or
                                   filesystem containing 'path'
exit                               Quit sftp
get [-afPpRr] remote [local]       Download file
reget [-fPpRr] remote [local]      Resume download file
reput [-fPpRr] [local] remote      Resume upload file
help                               Display this help text
lcd path                           Change local directory to 'path'
lls [ls-options [path]]            Display local directory listing
lmkdir path                        Create local directory
ln [-s] oldpath newpath            Link remote file (-s for symlink)
lpwd                               Print local working directory
ls [-1afhlnrSt] [path]             Display remote directory listing
lumask umask                       Set local umask to 'umask'
mkdir path                         Create remote directory
progress                           Toggle display of progress meter
put [-afPpRr] local [remote]       Upload file
pwd                                Display remote working directory
quit                               Quit sftp
rename oldpath newpath             Rename remote file
rm path                            Delete remote file
rmdir path                         Remove remote directory
symlink oldpath newpath            Symlink remote file
version                            Show SFTP version
!command                           Execute 'command' in local shell
!                                  Escape to local shell
?                                  Synonym for help

Open in new window

FTP: Yes ascii/binrary can be selected with extension this is called automatic transfer.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.