1. Create "text.enc" file in your documents folder using notepad (or download from attachment).
2. When the first messagebox comes up go to your documents folder and you will see the file "text.txt"
3. Then when the 2nd messagebox comes up look in your documents again and you will see a "text.enc" file.
Re: [VB 2005] Easy File Encryption/Decryption - Only 2 Lines Of Code!
by changing the extension all it does is cause windows to pop the dialog asking what program you want to use to open it. This is in no way secure whatsoever as the contents of the file are exactly the same and readable with any test editor.
Boooya
Visual Studio 2008 Professional
Don't forget to use [CODE]your code here[/CODE] when posting code
Don't forget to rate helpful posts!
If you're question was answered please mark your thread [Resolved]
Re: [VB 2005] Easy File Encryption/Decryption - Only 2 Lines Of Code!
Originally Posted by nbrege
This thread should be removed from the codebank, since it is useless...
I would not go so far as to call it useless, but I would agree that it does have issues that need to be resolved, and therefore, is more fitting in the .NET Q&A section.
Re: [VB 2005] Easy File Encryption/Decryption - Only 2 Lines Of Code!
I just meant that it is useless as far as encrypting is concerned, since the method the OP presents does not actually do any encrypting/decrypting. I hope I did not offend anyone...
Re: [VB 2005] Easy File Encryption/Decryption - Only 2 Lines Of Code!
This is coolest way to "encrypt" data. I used when I was 5.....
Does this My.Computer.FileSystem.RenameFile didn't mean anything to you? It very hard to start programming without knowing something like that..
Good luck!
Re: [VB 2005] Easy File Encryption/Decryption - Only 2 Lines Of Code!
This is possibly the silliest thread I've ever read. Given that the name of the method is RenameFile why would you think that it would do anything other than rename the file? The file name extension has no effect whatsoever on the contents of a file. You can give any file any extension you like. The only thing that does is prevent you opening the file by double-clicking it in Windows Explorer. You can still use File->Open in the same app and the file will open in all its glory. Try it with your allegedly encrypted text file and you'll see that you can still open it in Notepad and see all the text it contains. Don't you suppose that a method that encrypted a file would have "encrypt" somewhere in the name?