By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,820 Members | 1,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,820 IT Pros & Developers. It's quick & easy.

Shell Integration

dfound
P: 52
hi, Can anyone give me links to tutorials on shell integration.I am making a program to encrypt files in BC++ and I need it to show up option to encrypt and decrypt when I right-click on a file(or folder). Can anyone please give me those links. Also please give me the links to tutorial on making a file shredder because I want to know how it works. :-)
Feb 24 '07 #1
Share this Question
Share on Google+
10 Replies


sicarie
Expert Mod 2.5K+
P: 4,677
hi, Can anyone give me links to tutorials on shell integration.I am making a program to encrypt files in BC++ and I need it to show up option to encrypt and decrypt when I right-click on a file(or folder). Can anyone please give me those links. Also please give me the links to tutorial on making a file shredder because I want to know how it works. :-)
Not too sure how to make stuff show up in the right-click menu, but for a file shredder, it really depends on how secure you are talking. If you want DoD standard, the algorithm is to write random data across the disk at least six times before wiping with a NaN value (not a number) - or some value across the entire disk. Write random digits to memory. That's what it is.

The trick with file shredders is to make sure there is no residual charge from the original disk. Most US government agencies will (depending on the level of classification) overwrite the data, burn the hard drives to ash, and then store the ash for a set period of time to make sure the data is GONE.
Feb 24 '07 #2

dfound
P: 52
Well, I have a doubt. Instead of writing random data, can't I just truncate the file.
And by the way,does writing on the hard disk mean over writing the file itself...
Or is there any way to really write on the hard disk. :-)
Feb 25 '07 #3

sicarie
Expert Mod 2.5K+
P: 4,677
Well, I have a doubt. Instead of writing random data, can't I just truncate the file.
Truncate means shorten, so the data would still be at the beginning of the space in memory where the file resides - there would still be information there. If you don't care about a forensics analyst coming in and working on the computer, you can just delete it and empty your recycle bins and tmp folders - that'll keep 99% of people from finding it.
And by the way,does writing on the hard disk mean over writing the file itself...
Or is there any way to really write on the hard disk. :-)
Buffer memory, such as the Knoppix and Ubunut live CDs, can keep a program and basic OS while the hard drive is being formatted/overwritten. The Linux BBC (bootable business card) requires only - I think - 32mb to have a full command-line interface with several hundred programs, network support, disk-shredder...
Feb 25 '07 #4

dfound
P: 52
Well, Does it mean that I have to over write the file again and again , and then
delete it. I have created a program hat would read a file and over write it in some random manner. So if I the delete it using the "unlink" command, will it act as
a file shredder???
Feb 25 '07 #5

sicarie
Expert Mod 2.5K+
P: 4,677
Well, Does it mean that I have to over write the file again and again , and then
delete it. I have created a program hat would read a file and over write it in some random manner. So if I the delete it using the "unlink" command, will it act as
a file shredder???
That depends on how secure you want to make it. It has been proven possible to recover traces of magnetic charge on hard drives. This means that you can write something, then overwrite it, and still recover what was on there initially. It's possible, though extremely difficult.

The trick is to wipe the memory locations. Just because you write data to a file doesn't mean that its going to overwrite another copy, in fact, if you write as much, or more random data to a file, even if it's named the same thing, your OS is probably going to create a new file, and just remove the pointer to the old, letting that memory space be empty until it finds something it can put in there. Deleting and writing data to a file through Windows is not 100% secure...
Feb 26 '07 #6

dfound
P: 52
Then can you please tell me how to write over in the memory location. I have no idea about it. It will be very useful if you please give me some links to the same..
:-)
Feb 26 '07 #7

sicarie
Expert Mod 2.5K+
P: 4,677
Then can you please tell me how to write over in the memory location. I have no idea about it. It will be very useful if you please give me some links to the same..
:-)
I have never done something like that - so I don't know any good links for you (though I imagine a google search would be the place to start), I personally just used one of the available *nix tools to overwrite my entire hard drive.

Does anyone else know a good way to go about this?
Feb 26 '07 #8

dfound
P: 52
Thanks for your replies.I will try Google search.
Feb 27 '07 #9

sicarie
Expert Mod 2.5K+
P: 4,677
Thanks for your replies.I will try Google search.
It's definitely an interesting project - you could try to open a file and try to do something with the first character of it - get the memory location that way, and then start overwriting however much memory as the file is large. The problem will be if there are any pesky operating system end blocks or nodes, that might be overwritten, or if the file is not contiguous (I don't know enough about OS memory management to know how likely that is...).

Anyway, good luck and let me know what you find out - I'm very curious!
Feb 27 '07 #10

dfound
P: 52
Hi, the only thing I could dig up from some examples was that those programs only overwrites the file.There is nothing to be seen about those memory spaces.
Do you think the following program would work as a shredder.

Expand|Select|Wrap|Line Numbers
  1. #include<fstream.h>
  2. #include<dos.h>
  3. #include<string.h>
  4. int main()
  5. {
  6. long ctr=0;
  7. ifstream fin("testfile.txt",ios::in|ios::binary);
  8. ofstream fout("testfile.txt",ios::out|ios::ate|ios::nocreate|ios::binary);
  9. char buf[32768];
  10. if(!fin||!fout)
  11. return 0;
  12. while(!fin.eof())
  13. {                                                         //ANOTHER METHOD    
  14. fin.seekg(ctr*32768);                             //fin.seekg(ctr);
  15. fin.read((char*)&buf,strlen(buf));              //fin.get(ch);
  16. for(long i=0;i<strlen(buf);i++)                  //ch='0';
  17. buf[i]='0';                                          
  18. fout.seekp(ctr*32768);                           //fout.seekp(ctr);
  19. fout.write((char*)&buf,strlen(buf));           //fout.put(ch);
  20. ctr++;
  21. }
  22. fin.close();
  23. fout.close();
  24. unlink("testfile.txt");
  25. return 0;
  26. }
The program does overwrite the contents and then deletes it.
Feb 28 '07 #11

Post your reply

Sign in to post your reply or Sign up for a free account.