-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEncrypt.java
More file actions
34 lines (29 loc) · 745 Bytes
/
Encrypt.java
File metadata and controls
34 lines (29 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
public class Encrypt extends Symmetric {
Encrypt(){}
Encrypt(String message, String password)
{
super();
this.message = message;
}
void setData()
{
System.out.print("Enter Your Message::> ");
this.message = super.StrScanner.nextLine();
super.passwordSetter();
}
void show()
{
System.out.println(hash);
}
void encryptMain()
{
String temp = "";
int itemp;
for(int i=0;i<this.message.length();i++)
{
itemp = (int) message.charAt(i);
temp += String.valueOf(Character.toChars(itemp+(int)password.charAt(i%password.length())));
}
this.hash = temp;
}
}