Official Site

click here to view our new site launched

Pages

Thursday, August 19, 2010

Simple Encryptor

" An encryptor converts meaningful information into gibbrish form so that it is safe from the eyes of unauthorized people "
import javax.swing.*;
import java.io.*;
public class encrypt
{
public static void main(String arg[]) throws FileNotFoundException, IOException
{
String choice = JOptionPane.showInputDialog("Encrypt(E)/Decrypt(D)");
String file= JOptionPane.showInputDialog("File Name:");
File usrfile = new File(file);
File encfile = new File("enc.txt");
encfile.createNewFile();
BufferedWriter userStream = new BufferedWriter( new FileWriter(encfile));
try
{
PushbackReader in = new PushbackReader( new BufferedReader ( new FileReader(usrfile)));
int c=-4,i=0,temp=0;
while(c!=-1)
{
c=in.read();
temp=c;
if(c==-1)break;
if(choice.equals("e")||choice.equals("E"))
{
if(temp%2==0)temp+=9;
else temp-=7;
}
else if(choice.equals("d")||choice.equals("D"))
{
if(temp%2!=0)temp-=9;
else temp+=7;
}
userStream.write(String.valueOf((char)temp));
}
in.close();
userStream.close();
usrfile.delete();
File usrfile2 = new File(file);
encfile.renameTo(usrfile2);
}
catch(IOException e)
{
JOptionPane.showMessageDialog(null,e);
}
System.exit(0);
}
}
Execute the above program.
Encrypt(E)/Decrypt(D)
enc2
File Name:
enc3
Sample File
en1
Encrypted File
enc4
To get back the non-gibberish form or decrypted text, execute the code once again and enter d in the first window and file name in the following window.
Note:
  • This code can be used to encrypt/decrypt only files encoded in Text Format
  • The file to be encrypted has to be in the same folder from which the code is executed.
  • Sound knowledge of Java is required to understand and successfully execute the above code.

Friday, August 6, 2010

Shutdown Computer with Your Cell Phone

Shutdown Computer with Your Cell Phone

Using this method, a user can shutdown, restart, hibernate, etc. his or her computer, just by sending an email from his or her phone.

To do this, all you will need is Microsoft Outlook which should come withMicrosoft Office, which most people have. This will need to be on thecomputer wish you wish to shutdown.

So, this is how you do this:


1. First, you need the batch files to perform the Shutdown, Hibernate etc. You can write them down yourselves

2. open your note pad

and write lik this...

c:\windows\system32\shutdown -s -f -t 00

and save it as shutdown.bat

3. Open up Microsoft Outlook. Make sure that you have already configured it for your email.Now we will need to make it so that Outlook checks your inbox about every minute (1 minute for testing time can be increased if a delayed shutdown is desired). You can do this by going to Tools: Options.

4. Then click the Mail Setup tab, and afterwards, the Send/Receive button.

5. Make sure that the Schedule an automatic send/receive every... box is checked, and set the number of minutes to 1. Now you may close all of these dialog boxes.

6. Now go to Tools: Rules and Alerts... Next click the options button in the upper right hand corner and press the Import Rules button.

7. Now select the shutdown.bat file ...whi u hv created ...

8. Now, when you send a message from your phone to your e-mail address with the subject shutdown or smsshutdown%%, your computer will shutdown.
JSP-Servlets for creating Excel Sheet dynamically
$2.49 .COM at GoDaddy.com! Expires 5/14/13