• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 580
  • Last Modified:

Scrambling filenames

Hello,

I would like to know of an algorithm to be able to scramble (rename to something meaningless) a new file that i just created and unscramble it as i need to read from it.

A little code sample would be great.

Thanks for your help.

0
moloko
Asked:
moloko
  • 6
  • 4
  • 2
  • +5
1 Solution
 
OttaCommented:
How about "rotate-13" encryption?
Take the decimal-value for each byte, and add decimal 13.
If the result is greater than 256, subtract 256.
Convert the decimal-value back to character.

Obviously, this is a "one-to-one" mapping, and is easily "reversible", and there is nothing "magic" about the value '13'.

On some computers, e.g., IBM System/390,
there is a machine-language 'TRANSLATE' instruction,
which can very-quickly do this "one-to-one" mapping.

Or, the 'ZIP' program can compress the file,
*AND* require a password to decompress the file.
0
 
molokoAuthor Commented:
Do you have a sample code, i am not very familiar with it.

Thanks.
0
 
jwalsh88Commented:
What is your purpose for doing this?  Do you just want to secure a file?  Why not use file encryption?  PGP freeware will allow you to encrypt files and unencrypt them from your machine with just a passphrase.  But you have to be on your machine or on a machine with PGP and your private keys installed.  So, even if someone got the file and the passphrase they couldn't open the file on any computer that wasn't yours.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
molokoAuthor Commented:
What i need is very simple.
I need an algorithm to "rename" the file that i created to something meaningless (the files are NT usernames) for security reasons.  Then, i will do the encryption on them, which i know how to do.

Then, when i read the filename, i would need to run the algorithm again to bring it back to its original filename and decrypt it.

What do i rename it to is not important, as long as it is something noone can make sense of it.

Thanks.
0
 
jwalsh88Commented:
why can't you just make your own algorithm to do this.  Nothing personal but don't you think that is a little extreme?
0
 
OttaCommented:
> What do i rename it to is not important

Then, use the same "rotate-by-13" algorithm,
both for the name of the file and for its contents.
0
 
Droby10Commented:
> as long as it is something noone can make sense of it.

someone will make sense of it given enough time.
0
 
batkungCommented:
why not just password zip the file?
0
 
jwalsh88Commented:
why would he want to password zip the file ?
0
 
OttaCommented:
> why would he want to password zip the file ?

Privacy -- _ONLY_ he would be able to access the file.
0
 
jwalsh88Commented:
He already stated that he will be encrypting the file which is much better encryption then if he password zip the file.  He just wants more privacy on top of the encryption.  Once encrypted, he wants to scramble the filename so people don't think it's something important.  What he doesn't realize is that will just attract more attention to it.  If I really don't want someone to find a file I will usually rename it to something like:
c:\winnt\ODBCINT.INI

Then it looks like a normal system file and when I want to open it I rename it back temporarily.

Anyways, the reason I asked why would he want to do that is because he is already using a much better encryption scheme.  

password protected .zip files are easily cracked.
0
 
m_nortonCommented:
I'd use PGP.  You can encrypt the files, and only your key can unlock them.
0
 
jwalsh88Commented:
m_norton,

I already suggested that, he has the encryption taken care of.  He still wants to scramble the filename.
0
 
OttaCommented:
> password protected .zip files are easily cracked.

How?  (Other than a "brute force" approach?)

> He still wants to scramble the filename.

MOLOKO, please tell us if the above comments have been helpful,
or if you still have unresolved issues.

Thanks.
0
 
jwalsh88Commented:
Otta I am not arguing that password protected .zip files aren't a good idea.  What I am saying is that he is already using something better to protect the file against attack.  Now he wants something that will also rename that file to avoid people trying to attack it.  I didn't really look at your answer for an algorithm but I am sure that addresses his needs for changing the files name.
0
 
zenlion420Commented:
Hey people,

No comment has been added in roughly 2 years, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question
be PAQ'd and pts forfeited.
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Zenlion420
EE Page Editor
0
 
SpazMODicCommented:
PAQed - no points refunded (of 50)

SpazMODic
EE Moderator
0

Featured Post

SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

  • 6
  • 4
  • 2
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now