Viruses today are not just designed to cause damage to your data and system but also to steal some of your sensitive information, hence it is very important today that you somehow protect your data in a manner, such that if in case it gets stolen, it is still not in a usable format to the second person……
This is done through Data Encryption.
Data Encryption is one of the many ways by which one can protect his sensitive data from getting stolen, or misused. Many different methods can be employed to encrypt a data.
So here a simple Program written in ‘C’ and ‘Batch’ that implements data encryption and its decryption of a text file.
You can easily store all your passwords in a text file and then encrypt it so that you have it safe with you.
‘Batch File’ part of the program:-
echo Your password please!!
if NOT %pass%==hitachi goto FAIL
echo Enter the name of the file
echo Press “E or e” for Encryption and “D or d” for Decryption.
if %input%==e goto encrypt
if %input%==d goto decrypt
ren %cho%.txt general.txt
ren encrypted.txt %cho%.txt
echo Encryption Successful…..
ren %cho%.txt encrypted.txt
ren general.txt %cho%.txt
echo Decryption Successful…..
echo Dude Sharpen your Skills first…..BYE
Echo Press “x” to exit or “c” to continue….
if %end%==x exit
if %end%==c goto start
‘C’ part of the program:-
1. First copy the batch program in notepad and save it by any name with the extension “.bat”.
2. Now copy the “C” part of the program one by one in any c editor(with compiler) and then build it to generate an
.exe file. Make sure that the c editor is capable of generating an exe file of the same bit as that of your operating system.Such as “Code Blocks”.
3. Copy the exe file in the same folder as that of your batch file.
4. You are good to go now….Run your batch file, type your password(here it is “hitachi” you can change it by replacing “hitachi” with any of your password in the batch file) and give the name of the file to be encrypted or decrypted.