Menu

#12 Option to keep rather than wiping original files.

closed
nobody
None
5
2023-10-07
2023-10-05
Mr. Oxw@ll
No

Found this old thread:
https://sourceforge.net/p/ccrypt/feature-requests/8/

But even though Mr. Sellinger answered right away I can't seem to get his approach to work. For instance, I have file.txt and want to encrypt it to file.txt.cpt BUT without having file.txt removed when encryption is done. This, I have yet not found a way to do. Also, the other way around, when deencrypting file.txt.cpt I would like a way to just decrypt the file.txt but not wiping the .cpt it came out of.

Discussion

  • Mr. Oxw@ll

    Mr. Oxw@ll - 2023-10-05

    Heh, if I had read the man page just a bit more I would have found the -c switch, which makes it possible to > the output wherever is to my liking. Neat. Anyways, this way I still have to type a phony filename for the output. A e.g. -k(eep) switch that simply uses the same naming uniform but keeps input (regardless of -d or -e for action) would still be highly appreciated! :)

     
  • Peter Selinger

    Peter Selinger - 2023-10-05

    Yes, and also, the method mentioned in my response to feature request 8 works, i.e., you can do ccrypt < infile > outfile. This of course presupposes that you are using an operating system that understands pipelines, like "<" and ">". Certainly Mac OS and Linux do; with Windows, it may depend on what kind of command line prompt you are using.

     
  • Mr. Oxw@ll

    Mr. Oxw@ll - 2023-10-06

    Thanks for quick response(s) on the matter. Yeah, I'm sometimes in Windows, sometimes in Linux. I reckon your "< > method" works in CMD.EXE environment, W10. However, I hold to the opinion that a simple switch for keeping original files would be great. That way, one who has the need for such possibility and who does not want to type the < > stuff every time won't have to write different batch scripts for different operating systems. Also, such scripts are not made with ease, well at least not with my very very small scripting/coding skills. I have just written a CC_EN.CMD and a CC_DE.CMD (respetively), to do what I wish for:

    The encoding script is pretty straightforward:
    if "%~1" == "" ( echo use: cc_en FIL_ATT_KRYPTERA ) else ( ccrypt -e < "%~1" > "%~1.cpt" )

    Whilst the decrypting part is more complicated. Assuming the encrypted file has .cpt suffix and in best of worlds I would not need to put in both "input" and "output" but only input.cpt and it would just cut the .cpt extention for output. Without having to write nestled Windows batch code I think I would need to call GAWK.EXE or some other GNU-Win32-binary to strip the .cpt etcetera etcetera. This was just too complicated so I ended up with using both "%1" and "%2" for decryption, see below.

    if "%~1" == "" ( echo use: cc_de "FIL_ATT_DEKRYPTERA" "UTDATA_FIL" ) else ( ccrypt -d < "%~1" > "%~2" )

    With a -keep switch built into ccrypt all this scripting would be uncalled for, and also one would not have to write equivalent script for Linux environment.

    Anyways, such feature is on my personal wish list.
    But hey, thanks for a really great piece of software! :)

     
  • Peter Selinger

    Peter Selinger - 2023-10-07
    • status: open --> closed
     

Log in to post a comment.