C# File Encryption

Joined
May 18, 2007
Messages
1,787
Reaction score
291
I've been trying different ways of encrypting a .ini file, but they all don't work out like I need it to. I need it to encrypt and decrypt the same file without having to have a different output from the input.

What would be the easiest way to do that?

Thanks.
 
I didn't ask what could happen. I simply asked how to do the above question. If your not going to help then don't post.

Google encryption. The .NET framework has encryption api (straight from microsoft's documentation: http://msdn.microsoft.com/en-us/library/ms867086.aspx).

Again, you're wasting your time implementing encryption when it's useless to a project. And this isn't what "could" happen. If you're trying to hide configuration by encrypting it, this is what WILL happen if what you make is even moderately useful. I guarantee it. It takes less than 10 minutes to have an app decrypting your ini files and re-encrypting them. We do it for apps written in C++ using themida and VM'ing **** with proprietary binary file protocols with filenames stripped out, don't ever believe someone won't break yours.
 
Better to have some then none, rather have people work for it if they want it that badly then to just have it handed on a silver platter

Let's put it this way, it'll take you about 5000x longer to implement it than it will for someone to break it. And even then, it will only in the future serve as a hindrance to you (trust me, just wait).
 
jMerlin, I respect you and all, but going in every C# thread just to bash the language is sort of childish.

I agree, I was just about to say this. While I can see what jMerlin is saying in most of his threads in where he is generally right about the functionality of C++ over C# in certain areas. C# can hold its own in its own right. Merlin is shying people away from discovering what a great language C# is.
 
jMerlin, I respect you and all, but going in every C# thread just to bash the language is sort of childish.

I'm not bashing the language. I'm bashing the notion of trying to secure an application written in a language which can be readily DECOMPILED nearly perfectly by one of a million available decompilers.

It's like trying to hide by jumping behind a piece of transparent glass. It's not really helping you.
 
C# isn't a language built around security, redistributing, or optimization to the next level. Seeing as it's ran inside a VM unlike C/C++ which is native code, there is as completely huge difference. No matter what you do, we'll always be able to unpack and decrypt something you do. You can never stop anyone from doing anything. You can attempt to prevent such things but no matter what it will fail. Next, if you need to encrypt an INI, then that INI is useless. If you want to do anything of the sort move to to a resource file and continue on that way. No matter what your solution is you will never have to encrypt a file when using C#, that's just rediculous. Next, to those saying C# is a wonderful language, I want you to know that all C# does is wraps the WinAPI for you. For an example, gaing a process, all you have to do is Process.GetProcessByName() while we have to iterate the proces structure mainly using Process32Next. It's just pathetic that you guys don't know how things work and it's all handed to you on a silver platter. /rage
 
Thanks paul, I found out how to do xor, it works.


Btw: the rest of you. I didn't ASK you for your opinion on C#, nor do I care what it is, it does what I want it to do and that's the bottom line. So go rage on some one else's thread
 
Last edited:
Thanks paul, I found out how to do xor, it works.


Btw: the rest of you. I didn't ASK you for your opinion on C#, nor do I care what it is, it does what I want it to do and that's the bottom line. So go rage on some one else's thread

Post your app somewhere sometime, I'll post your ini in plaintext and a tool to re-encrypt it for use.

You're better off hardcoding those values.
 
Back