Encrypting filename with file

  • Thread starter Thread starter dick
  • Start date Start date
D

dick

Hello,

I want to encrypt a file with its filename.
I can encrypt the file itself using the frame libraries.

How can I now best hide the filename and extension?
Within the file, ... ?

I must be able to retrieve the filename after decrypting.
The original files have random filenames and extensions.

example:

original file: username.sec
encrypted file with orig filename: username.sec
encrypted file with encrypted filename: mydate.dat

After encryption I must have username.sec again.

TIA
 
* "dick said:
I want to encrypt a file with its filename.
I can encrypt the file itself using the frame libraries.

How can I now best hide the filename and extension?
Within the file, ... ?

I must be able to retrieve the filename after decrypting.
The original files have random filenames and extensions.

example:

original file: username.sec
encrypted file with orig filename: username.sec
encrypted file with encrypted filename: mydate.dat

After encryption I must have username.sec again.

This would make encryption useless. The key used for
encrtyption/decryption is the most important part and storing it in a
format that can be easily read doesn't make much sense.
 
Hello,

I don't mean storing the key, but the actual filename.

When the file is named "user.jpg", I want it saved as Enc1.dat or something
like that.
Later I must be able to retrieve the original filename from the encrypted
file, for restoring to the original file.
 
* "dick said:
I don't mean storing the key, but the actual filename.

OK, I misread your question, I thought you are using the filename as
encryption key. You can, for example, add sort of "header" to your file
that contains the file name. A very simple approach would be to store
the filename followed by a certain sequence of characters at the
beginning of the file. Then you will have to extract this data and pass
the rest of the file to your decryption routine.
 
Back
Top