MythTheWolf
MythTheWolf

Reputation: 55

Batch files - encryption/decryption

So In a folder on my computer there's files named after users. Ex: myth.uuid

In those .uuid files is text telling what a user's password is. Ex: 123567

I wanted a batch file to encrypt it to random mess but another batch file that can decrypt it back into plain text. Any ideas? I am using windows 7.

Upvotes: 2

Views: 10705

Answers (3)

npocmaka
npocmaka

Reputation: 57322

It's rather obfuscation than encrytion :

certutil -encodehex myth.uuid myth.hex
certutil -decodehex myth.hex myth.uuid

or

certutil -encode myth.uuid myth.b64
certutil -decode myth.b64 myth.uuid

In both cases first line encodes the file and the second decodes it.First one to/from HEX the second Base64.You can use some combination for more obfuscated results.For encoding file to hex you can also check file2hex.bat which will strip the data of the file and still you'll be able to use certutil -decodehex

Upvotes: 4

rojo
rojo

Reputation: 24476

There are many ways. You could install 7-zip and use 7za outfile.7z myth.uuid -pPassword to encrypt. You could use JScript with xxtea.js and base64.js (or perhaps npocmaka's certutil method for base64 (en|de)coding. You could install TrueCrypt to mount / umount an encrypted volume as needed. You could install and use GPG4Win as suggested by Maarten. You could employ a PowerShell Secure-String cmdlet. You can use cipher.exe (brief tutorial). You can do probably dozens of other things to encrypt / decrypt from a command line.

Upvotes: 3

Maarten Bodewes
Maarten Bodewes

Reputation: 94088

Use GPG encryption, the command line utility is also available pre-build for Windows. I would recommend public key encryption using a generated PGP key pair.

Upvotes: 2

Related Questions