Solved

Scrambling filenames

Posted on 2001-08-24
17
551 Views
Last Modified: 2010-05-18
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
Comment
Question by:moloko
  • 6
  • 4
  • 2
  • +5
17 Comments
 
LVL 12

Expert Comment

by:Otta
Comment Utility
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
 

Author Comment

by:moloko
Comment Utility
Do you have a sample code, i am not very familiar with it.

Thanks.
0
 
LVL 4

Expert Comment

by:jwalsh88
Comment Utility
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
 

Author Comment

by:moloko
Comment Utility
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
 
LVL 4

Expert Comment

by:jwalsh88
Comment Utility
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
 
LVL 12

Expert Comment

by:Otta
Comment Utility
> 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
 
LVL 5

Expert Comment

by:Droby10
Comment Utility
> as long as it is something noone can make sense of it.

someone will make sense of it given enough time.
0
 
LVL 1

Expert Comment

by:batkung
Comment Utility
why not just password zip the file?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 4

Expert Comment

by:jwalsh88
Comment Utility
why would he want to password zip the file ?
0
 
LVL 12

Expert Comment

by:Otta
Comment Utility
> why would he want to password zip the file ?

Privacy -- _ONLY_ he would be able to access the file.
0
 
LVL 4

Expert Comment

by:jwalsh88
Comment Utility
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
 
LVL 1

Expert Comment

by:m_norton
Comment Utility
I'd use PGP.  You can encrypt the files, and only your key can unlock them.
0
 
LVL 4

Expert Comment

by:jwalsh88
Comment Utility
m_norton,

I already suggested that, he has the encryption taken care of.  He still wants to scramble the filename.
0
 
LVL 12

Expert Comment

by:Otta
Comment Utility
> 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
 
LVL 4

Expert Comment

by:jwalsh88
Comment Utility
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
 
LVL 5

Expert Comment

by:zenlion420
Comment Utility
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
 

Accepted Solution

by:
SpazMODic earned 0 total points
Comment Utility
PAQed - no points refunded (of 50)

SpazMODic
EE Moderator
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now