- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDecrypt.java
More file actions
Latest commit
32 lines (29 loc) · 734 Bytes
/
Copy pathDecrypt.java
File metadata and controls
32 lines (29 loc) · 734 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
publicclassDecryptextendsSymmetric {
Decrypt(){}
Decrypt(Stringhash, Stringpassword)
{
super();
this.hash = hash;
}
voidsetData()
{
System.out.print("Enter Your Encrypted Text::> ");
this.hash = super.StrScanner.nextLine();
super.passwordSetter();
}
@Override
voidshow() {
System.out.println(message);
}
voiddecryptMain()
{
Stringtemp = "";
intitemp;
for(inti=0;i<this.hash.length();i++)
{
itemp = (int) hash.charAt(i);
temp += String.valueOf(Character.toChars(itemp-(int)password.charAt(i%password.length())));
}
this.message = temp;
}
}