Encrypting, decrypting files

May 20, 2008
3,515
4
Elkridge, MD, USA
Question
Is there a TCC command I can use to encrypt or decrypt a file on a
system which supports NTFS encryption, e.g., WinXP Pro? The analogous issue
for compression / expansion is the ATTRIB +C / ATTRIB -C command pair to do
it "in situ", or copying between compressed and uncompressed directories
using either COPY or MOVE.

Problem
I mapped a network drive containing encrypted files on a system running
WinXP Pro to another system running WinXP home. Read access to the encrypted
files just resulted in "access denied", not a problem. However, using the /U
option of COPY from the system without encryption to update encrypted files
was catastrophic: despite "access denied" messages for each file, the
encrypted files were replaced with empty (0-byte) files with new timestamps,
retaining the encrypted attribute. Both systems have WinXP SP3, and TCC
11.00.51.
--
Steve
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
> Question
> Is there a TCC command I can use to encrypt or decrypt a file on a
> system which supports NTFS encryption, e.g., WinXP Pro?

There is no internal TCC command to do that.


> Problem
> I mapped a network drive containing encrypted files on a system
> running WinXP Pro to another system running WinXP home. Read access
> to the encrypted files just resulted in "access denied", not a problem.
> However, using the /U option of COPY from the system without encryption
> to update encrypted files was catastrophic: despite "access denied"
> messages for each file, the encrypted files were replaced with empty
> (0-byte) files with new timestamps, retaining the encrypted attribute.

That's a Windows issue, not TCC.

The COPY command uses the Windows CopyFile API to do all the work. XP Home
does not support encrypted files, though I'm surprised it went so far as to
blow away the encrypted files.

Have you tried it with CMD?

Rex Conn
JP Software
 
May 20, 2008
3,515
4
Elkridge, MD, USA
|| Is there a TCC command I can use to encrypt or decrypt a file
|| on a system which supports NTFS encryption, e.g., WinXP Pro?
| There is no internal TCC command to do that.

Please consider this a request for such in a future version.

|| Problem
|| I mapped a network drive containing encrypted files on a system
|| running WinXP Pro to another system running WinXP home. Read access
|| to the encrypted files just resulted in "access denied", not a
|| problem. However, using the /U option of COPY from the system
|| without encryption to update encrypted files was catastrophic:
|| despite "access denied" messages for each file, the encrypted files
|| were replaced with empty (0-byte) files with new timestamps,
|| retaining the encrypted attribute.

| That's a Windows issue, not TCC.
|
| The COPY command uses the Windows CopyFile API to do all the work.
| XP Home does not support encrypted files, though I'm surprised it
| went so far as to blow away the encrypted files.

I suggest a work-around to avoid destruction of files (just one more
Windows bug for you to worry about). While I can avoid the issue in future,
more naive users in the same circumstances will - wrongly, though - blame
TCC. OTOH there will be many more users in the future who try to transfer
files between encrypted and plain file systems.

BTW, I just tried "COPY/O *" to the encrypted target, and it reported
for each file first the attempt to copy (src => tgt), then the "Access is
denied" message. No targets were created. Early detection of unfulfillable
user request could save users lots of time.

| Have you tried it with CMD?

No, I never use CMD. I became a JPsoft addict decades ago!
--
Steve
 
| For handling encryption unter NTFS, there is a Win XP command line
| utility named *CIPHER* you can call from TCC.
|
| Here's an overview of its options and uses:
| http://ss64.com/nt/cipher.html

Thanks, but it does not have a link for downloading the program.
--
Steve

CIPHER comes with Windows XP. I just typed CIPHER from TCC and it gave me the following;

Code:
Displays or alters the encryption of directories [files] on NTFS partitions.

  CIPHER [/E | /D] [/S:directory] [/A] [/I] [/F] [/Q] [/H] [pathname [...]]

  CIPHER /K

  CIPHER /R:filename

  CIPHER /U [/N]

  CIPHER /W:directory

  CIPHER /X[:efsfile] [filename]

    /A        Operates on files as well as directories. The encrypted file
              could become decrypted when it is modified if the parent
              directory is not encrypted. It is recommended that you encrypt
              the file and the parent directory.
    /D        Decrypts the specified directories. Directories will be marked
              so that files added afterward will not be encrypted.
    /E        Encrypts the specified directories. Directories will be marked
              so that files added afterward will be encrypted.
    /F        Forces the encryption operation on all specified objects, even
              those which are already encrypted.  Already-encrypted objects
              are skipped by default.
    /H        Displays files with the hidden or system attributes.  These
              files are omitted by default.
    /I        Continues performing the specified operation even after errors
              have occurred.  By default, CIPHER stops when an error is
              encountered.
    /K        Creates new file encryption key for the user running CIPHER. If
              this option is chosen, all the other options will be ignored.
    /N        This option only works with /U. This will prevent keys being
              updated. This is used to find all the encrypted files on the
              local drives.
    /Q        Reports only the most essential information.
    /R        Generates an EFS recovery agent key and certificate, then writes
              them to a .PFX file (containing certificate and private key) and
              a .CER file (containing only the certificate). An administrator
              may add the contents of the .CER to the EFS recovery policy to
              create the recovery agent for users, and import the .PFX to
              recover individual files.
    /S        Performs the specified operation on directories in the given
              directory and all subdirectories.
    /U        Tries to touch all the encrypted files on local drives. This will
              update user's file encryption key or recovery agent's key to the
              current ones if they are changed. This option does not work with
              other options except /N.
    /W        Removes data from available unused disk space on the entire
              volume. If this option is chosen, all other options are ignored.
              The directory specified can be anywhere in a local volume. If it
              is a mount point or points to a directory in another volume, the
              data on that volume will be removed.
    /X        Backup EFS certificate and keys into file filename. If efsfile is
              provided, the current user's certificate(s) used to encrypt the
              file will be backed up. Otherwise, the user's current EFS
              certificate and keys will be backed up.


    directory A directory path.
    filename  A filename without extensions.
    pathname  Specifies a pattern, file or directory.
    efsfile   An encrypted file path.

    Used without parameters, CIPHER displays the encryption state of
    the current directory and any files it contains. You may use multiple
    directory names and wildcards.  You must put spaces between multiple
    parameters.
Joe
 
May 20, 2008
3,515
4
Elkridge, MD, USA
| CIPHER comes with Windows XP.
...
Thanks, you are partially right. It comes only with WinXP Pro. I tried it on
the WinXP home system only. Well, I believe I have all the tools I need to
upgrade it to Pro.
--
Steve
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
Steve,

I might have skimmed your email a little too quickly. But why can't you
just use the built-in EFS in Windows?

-Scott

Steve F$BaC(Bi$BaO(B <> wrote on 07/23/2010 08:49:02 AM:


> | For handling encryption unter NTFS, there is a Win XP command line
> | utility named *CIPHER* you can call from TCC.
> |
> | Here's an overview of its options and uses:
> | http://ss64.com/nt/cipher.html
>
> Thanks, but it does not have a link for downloading the program.
> --
> Steve
>
>
>
>
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
> || Is there a TCC command I can use to encrypt or decrypt a file
> || on a system which supports NTFS encryption, e.g., WinXP Pro?
> | There is no internal TCC command to do that.
>
> Please consider this a request for such in a future version.

But -- you said you're using XP Home, which does not support encryption.
And if you updated to XP Pro (or Win 7), you'd have that utility as part of
the OS.

So I'm not clear just what you're asking for.

Rex Conn
JP Software
 
May 20, 2008
3,515
4
Elkridge, MD, USA
||| Is there a TCC command I can use to encrypt or decrypt a file
||| on a system which supports NTFS encryption, e.g., WinXP Pro?
|| There is no internal TCC command to do that.
| Please consider this a request for such in a future version.
| But -- you said you're using XP Home, which does not support
| encryption. And if you updated to XP Pro (or Win 7), you'd have that
| utility as part of the OS.
|
| So I'm not clear just what you're asking for.

Yes, the external utility is available as I since learned. However,
there are many other external utilities that TCC now emulates using internal
commands. I think this would be another good candidate so the user could use
the unified syntax of TCC instead of learning the peculiarities of each
external.
--
Steve
 
May 20, 2008
3,515
4
Elkridge, MD, USA
| I might have skimmed your email a little too quickly. But why can't
| you just use the built-in EFS in Windows?

Scott:
Thanks, I am doing that. When I posted my previous message I was not
aware that CIPHER.EXE is included in the WinXP Pro distribution. Too bad
they did not combine compression and encryption.
--
Steve
 
Similar threads
Thread starter Title Forum Replies Date
MickeyF TCC crashing when copying multiple files (now resolved) Support 6
fpefpe How to? shortcuts and batch files Support 4
C v28 key files Support 2
J ffind does not find files Support 4
C duplicate files in multiple plugin sites Support 9
Dmitry L. Kobyakov Fixed The SETARRAY /R command works incorrectly with cyrillic files Support 2
S How to? Deinstalling TC/reinstating execution of bat files by cmd in Win7 Support 31
vefatica FFIND, temp files? ... not deleted? Support 0
R FUNCTION to count NUMBER of files matching a pattern and specific length/not length Support 4
vefatica Tmp files from in-process pipes not deleted Support 6
vefatica Finding files with alternate data streams? Support 4
rps Multi-column DIR /v not displaying all files. Support 5
D How to skip files in a fileset? Support 6
vefatica PIPEVIEW leaves TMP files Support 18
K "copy /z /w" command not deleting read-only files in destination Support 10
Jesse Heines "Taken" date for JPG and PNG files Support 4
O I cannot use links to .btm files Support 5
C How to? rename files with spaces Support 8
R How to? Append files in multiple subfolders using copy? Support 8
Joe Caverly "Functions" in cmd.exe batch files Support 6
S Batch files Calling Batch Files Support 2
vefatica Find Files/Text dialog: does it work? Support 0
Joe Caverly UNZIPping older .ZIP files Support 3
C Documentation default location for LOG files Support 21
P exit /b in batch files Support 7
P Labels in batch files: TCC vs CMD.exe Support 9
M ANSI is used to show files instead of OEM in version 17 to 19 ! Support 5
C 7Z files on forum? Support 0
x13 Problem listing repository files using DIR http(s)://... Support 8
B Can copy command concatenate multiple mp3 files Support 2
redwdc Copying files with spaces, commas, etc. Support 5
J New lexer for TCC batch files. Support 0
M How to? want to download a file from a website enumarate the links and download the files Support 2
keithg1964 TCC RT Install Files Support 1
P Fixed Rexx .cmd files no longer work in TCC 20 Support 3
thorntonpg Handling files with embedded spaces Support 1
WavSlave Fixed Unable to sort files by description in TCC v19 Support 2
P Files older - exist Support 1
D safe delete files command Support 10
P Copying files in subdirectories Support 9
C WAD VIEW print multiple files - switches fail Support 10
MikeBaas How to? SELECT: exclude files / display prompt Support 2
Phileosophos WAD Can't rename files in subfolders Support 1
nickles WAD del unable to delete files ending in "." Support 18
P Rename files with ampersand in the name Support 1
C Touch command — I Need to touch matching files in another directory. Support 5
S iftp copying pgp files from ftp is not working Support 11
M Fixed Cannot use the "Browse..." function in "Find files/text" dialogbox Support 2
fromano How to? Everything finding directories with 2 or more files in them Support 3
vefatica Empty .watch files saved Support 0

Similar threads