xor encryption

Hello, I am trying to encrypt the output from a java application to store passwords any help would be greatly appreciated.
1
2
3
4
5
6
7
#include <cstdio>
#include <cstdlib>
int main()
{
    freopen("mymcacount","a",stdout);
    system("java minecraft");
}
Last edited on
So you have your passwords where?
I have one question: Why use stdout and fstream in the same program? I really donn't understand, you include fstream, don't include cstdio, use printf, and don't use fstream!
The problem is that you use functions that aren't included! As for encryption: http://www.cplusplus.com/articles/4iLN8vqX/ http://www.cplusplus.com/articles/36A0RXSz/ http://www.cplusplus.com/articles/Ly86b7Xj/
To encrypt/decrypt data windows has cryptography functions built in, in linux you could use OpenSSL functions.

To "get" the output of another program use a pipe.

I have one question: Why use stdout and fstream in the same program? I really donn't understand, you include fstream, don't include cstdio, use printf, and don't use fstream!


Thanks for pointing that out I revised the code.

To encrypt/decrypt data windows has cryptography functions built in, in linux you could use OpenSSL functions.

I would like use crypto++.

also how do I create a pipe because I want to encrypt the out put before its save to a file.
Last edited on
Actually xor would be good. But I would like to pipe the output from java to xor and then to a txt file.
You have an example here if you use windows:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682499%28v=vs.85%29.aspx

Don't know how to do it in *nix world, except use | (pipe operator) directly.
Something like:
java minecraft | myprogram

You get the output of that command from stdin of your program.
Topic archived. No new replies allowed.