//Simple Encryptor
import java.io.*;
class Encryptor
{
public static void main(String args[])
{
String in;
Console con=System.console();
int length=0;
System.out.print(" Enter your Password to be encrypted: ");
in=con.readLine();
length=in.length();
char a[]= new char[length];
char b[]= new char[length];
for(int i=0;i<length;i++)
{
int temp;
a[i]=in.charAt(i);
temp=((int)a[i])+i*i+3;
b[i]=(char)temp;
}
System.out.print("\n Encrypted password is: ");
for(int i=0;i<length;i++)
{
System.out.print(b[i]);
}
}
}
import java.io.*;
class Encryptor
{
public static void main(String args[])
{
String in;
Console con=System.console();
int length=0;
System.out.print(" Enter your Password to be encrypted: ");
in=con.readLine();
length=in.length();
char a[]= new char[length];
char b[]= new char[length];
for(int i=0;i<length;i++)
{
int temp;
a[i]=in.charAt(i);
temp=((int)a[i])+i*i+3;
b[i]=(char)temp;
}
System.out.print("\n Encrypted password is: ");
for(int i=0;i<length;i++)
{
System.out.print(b[i]);
}
}
}
No comments:
Post a Comment