File tree Expand file tree Collapse file tree 2 files changed +1
-15
lines changed
src/main/java/com/thealgorithms/ciphers Expand file tree Collapse file tree 2 files changed +1
-15
lines changed Original file line number Diff line number Diff line change 195
195
<Match >
196
196
<Bug pattern =" DRE_DECLARED_RUNTIME_EXCEPTION" />
197
197
</Match >
198
- <Match >
199
- <Bug pattern =" SLS_SUSPICIOUS_LOOP_SEARCH" />
200
- </Match >
201
198
<Match >
202
199
<Bug pattern =" BAS_BLOATED_ASSIGNMENT_SCOPE" />
203
200
</Match >
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ static String decryptCipher(String cipher) {
68
68
// then i will be the multiplicative inverse of a
69
69
if (flag == 1 ) {
70
70
aInv = i ;
71
+ break ;
71
72
}
72
73
}
73
74
for (int i = 0 ; i < cipher .length (); i ++) {
@@ -83,16 +84,4 @@ static String decryptCipher(String cipher) {
83
84
84
85
return msg .toString ();
85
86
}
86
-
87
- // Driver code
88
- public static void main (String [] args ) {
89
- String msg = "AFFINE CIPHER" ;
90
-
91
- // Calling encryption function
92
- String cipherText = encryptMessage (msg .toCharArray ());
93
- System .out .println ("Encrypted Message is : " + cipherText );
94
-
95
- // Calling Decryption function
96
- System .out .println ("Decrypted Message is: " + decryptCipher (cipherText ));
97
- }
98
87
}
You can’t perform that action at this time.
0 commit comments