Console app., Encryption to a hidden folder
#include <stdio.h>
#include <windows.h>
int main( int argc, char* argv[] )
{
SetFileAttributes( "C:\\MYCOMPUTER\\DC++\\downloads\\xXx", FILE_ATTRIBUTE_HIDDEN );
}
-I need to add an encryption for that code, that messes up the bytes using a key. XOR encryption or something.
Or if there is another way to disable funny_football.avi from "xXx" folder to be ignitiated from somewhere else, like for example 'Recent Documents'.
Goal is to make the files under the folder un-executable.
--And may I remind you; I do not seek for this answer to be used in any illegal or harmful way, so lay off the "Hmmm, a bit suspicious. Skiddie?" -comments.
Thanks in advance.
[765 byte] By [
nextstep] at [2007-11-19 7:04:59]

# 1 Re: Console app., Encryption to a hidden folder
Could you describe a little more once again. I didn't quite understand, do you want to hide the file? or Encrypt the file?
Or if there is another way to disable funny_football.avi from "xXx" folder to be ignitiated from somewhere else, like for example 'Recent Documents'.
:confused:
Goal is to make the files under the folder un-executable.
usually files are un-exeutable (other then the .exe, .com, .bat etc files)
What exactely you want to acheive?
Ejaz at 2007-11-9 0:42:07 >

# 2 Re: Console app., Encryption to a hidden folder
Well either to hide the folder in such way that any files under the folder cannot be ignitiated, or to create an encryption added to the code above, that will make the folder hidden&encrypted and the files under the folder are un-ignitiable.
Example:
Run program -> Hide C:\MYCOMPUTER\DC++\downloads\xXx
or
Run program -> Hide & Encrypt C:\MYCOMPUTER\DC++\downloads\xXx
as long as the files under the folder cannot be ignitiated through anything (for example 'Recent Documents' or so)
# 3 Re: Console app., Encryption to a hidden folder
Well, once easy and non-programming solution can be, just zip the folder and if you want an added layer of security, set some password, there you go. :cool:
And do clean your recent document, temporary internet files and other relvant paths, you know...just in case ;)
Ejaz at 2007-11-9 0:44:09 >

# 4 Re: Console app., Encryption to a hidden folder
"Well, once easy and non-programming solution can be, just zip the folder and if you want an added layer of security, set some password, there you go."
-Right, except I was expecting a c++ command though.
--
Well what about just an encryption.
Run program -> Encrypt C:\MYCOMPUTER\DC++\downloads\xXx
I want it to do so directly, as the program is started. I don't want it to start asking me "What file do you want to be encrypted?" and so on.
So, do you have a simple code to do so?
# 5 Re: Console app., Encryption to a hidden folder
I never felt any need such that, I guess if you look through the documentation of winzip/winrar to see if you can pass some command line argument, which specify the folder path, then you can create a .bat file, just exeucte it and there you have it.
For very basic encryption, way back once I used unions (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/class_29.asp), the idea was, read the contents, add some value and store it to some other file and remove the original one, during decryption, read the encrypted file, subtract the value that you have added in the first place from the data set items and save to another file and you'll get the data back.
Ejaz at 2007-11-9 0:46:18 >

# 6 Re: Console app., Encryption to a hidden folder
I don't want any decrypt -command on the program or anything like it.
All I want, is a source code that will (when initiated) automatically encrypt a specific folder path, like c:\mycomputer\dc++\downloads\xxx
And it's done, nothing else.
Run program -> Encrypt the folder, that has the path in the source code.
# 7 Re: Console app., Encryption to a hidden folder
You can't encrypt a folder. You could encrypt all the files in a folder if you like. Try searching Google for "encryption algorithms" and I'm sure you'll find some useful code.