Solved

Scrambling filenames

Posted on 2001-08-24
17
567 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 2
  • +5
17 Comments
 
LVL 12

Expert Comment

by:Otta
ID: 6422283
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
ID: 6422514
Do you have a sample code, i am not very familiar with it.

Thanks.
0
 
LVL 4

Expert Comment

by:jwalsh88
ID: 6422653
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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 

Author Comment

by:moloko
ID: 6423143
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
ID: 6423188
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
ID: 6424340
> 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
ID: 6424731
> 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
ID: 6430604
why not just password zip the file?
0
 
LVL 4

Expert Comment

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

Expert Comment

by:Otta
ID: 6432436
> 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
ID: 6432864
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
ID: 6434900
I'd use PGP.  You can encrypt the files, and only your key can unlock them.
0
 
LVL 4

Expert Comment

by:jwalsh88
ID: 6435901
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
ID: 6436681
> 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
ID: 6437176
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
ID: 9706156
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
ID: 9755206
PAQed - no points refunded (of 50)

SpazMODic
EE Moderator
0

Featured Post

Is your NGFW recommended by NSS Labs?

Ours is! NSS Labs Next Generation Firewall Test gives the WatchGuard Firebox M4600 a "Recommended" rating! Curious where your NGFW landed on the  Security Value Map? See the map and download the full report today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email attacks are the most common methods for initiating ransomware and phishing scams. Attackers want you to open an infected attachment or click a malicious link, and unwittingly download malware to your machine. Here are 7 ways you can stay safe.
Recovering from what the press called "the largest-ever cyber-attack", IT departments worldwide are discussing ways to defend against this in the future. In this process, many people are looking for immediate actions while, instead, they need to tho…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Suggested Courses

696 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