s_nor/
lib.rs

1use std::{
2    fs::File,
3    io::Read,
4};
5
6
7pub fn encrypt(file: &str) -> Vec<u8> {
8    //println!("{}", "Please Give The File To Be Encrypted!".bold().blue());
9    //print!("> ");
10    //stdout().flush().unwrap();
11    //let mut file = String::new();
12    //io::stdin().read_line(&mut file).unwrap();
13    let file = file.trim().trim_matches('\"').trim_matches('\'');
14    let mut openf = File::open(file).unwrap();
15    let mut readcntnt = Vec::new();
16    openf.read_to_end(&mut readcntnt).unwrap();
17    let mut mapd = String::new();
18    for curc in readcntnt {
19        #[allow(unreachable_patterns)]
20        match curc {
21            b'A' => mapd.push_str("100"),
22            b'B' => mapd.push_str("101"),
23            b'C' => mapd.push_str("102"),
24            b'D' => mapd.push_str("103"),
25            b'E' => mapd.push_str("104"),
26            b'F' => mapd.push_str("105"),
27            b'G' => mapd.push_str("106"),
28            b'H' => mapd.push_str("107"),
29            b'I' => mapd.push_str("108"),
30            b'J' => mapd.push_str("109"),
31            b'K' => mapd.push_str("110"),
32            b'L' => mapd.push_str("111"),
33            b'M' => mapd.push_str("112"),
34            b'N' => mapd.push_str("113"),
35            b'O' => mapd.push_str("114"),
36            b'P' => mapd.push_str("115"),
37            b'Q' => mapd.push_str("116"),
38            b'R' => mapd.push_str("117"),
39            b'S' => mapd.push_str("118"),
40            b'T' => mapd.push_str("119"),
41            b'U' => mapd.push_str("120"),
42            b'V' => mapd.push_str("121"),
43            b'W' => mapd.push_str("122"),
44            b'X' => mapd.push_str("123"),
45            b'Y' => mapd.push_str("124"),
46            b'Z' => mapd.push_str("125"),
47            b'a' => mapd.push_str("200"),
48            b'b' => mapd.push_str("201"),
49            b'c' => mapd.push_str("202"),
50            b'd' => mapd.push_str("203"),
51            b'e' => mapd.push_str("204"),
52            b'f' => mapd.push_str("205"),
53            b'g' => mapd.push_str("206"),
54            b'h' => mapd.push_str("207"),
55            b'i' => mapd.push_str("208"),
56            b'j' => mapd.push_str("209"),
57            b'k' => mapd.push_str("210"),
58            b'l' => mapd.push_str("211"),
59            b'm' => mapd.push_str("212"),
60            b'n' => mapd.push_str("213"),
61            b'o' => mapd.push_str("214"),
62            b'p' => mapd.push_str("215"),
63            b'q' => mapd.push_str("216"),
64            b'r' => mapd.push_str("217"),
65            b's' => mapd.push_str("218"),
66            b't' => mapd.push_str("219"),
67            b'u' => mapd.push_str("220"),
68            b'v' => mapd.push_str("221"),
69            b'w' => mapd.push_str("222"),
70            b'x' => mapd.push_str("223"),
71            b'y' => mapd.push_str("224"),
72            b'z' => mapd.push_str("225"),
73            b'0' => mapd.push_str("150"),
74            b'1' => mapd.push_str("151"),
75            b'2' => mapd.push_str("152"),
76            b'3' => mapd.push_str("153"),
77            b'4' => mapd.push_str("154"),
78            b'5' => mapd.push_str("155"),
79            b'6' => mapd.push_str("156"),
80            b'7' => mapd.push_str("157"),
81            b'8' => mapd.push_str("158"),
82            b'9' => mapd.push_str("159"),
83            b'\n' => mapd.push_str("999"),
84            b' ' => mapd.push_str("898"),
85            b'!' => mapd.push_str("421"),
86            b'"' => mapd.push_str("422"),
87            b'#' => mapd.push_str("423"),
88            b'$' => mapd.push_str("424"),
89            b'%' => mapd.push_str("425"),
90            b'&' => mapd.push_str("426"),
91            b'\'' => mapd.push_str("427"),
92            b'(' => mapd.push_str("428"),
93            b')' => mapd.push_str("429"),
94            b'*' => mapd.push_str("430"),
95            b'+' => mapd.push_str("431"),
96            b',' => mapd.push_str("432"),
97            b'-' => mapd.push_str("433"),
98            b'.' => mapd.push_str("434"),
99            b'/' => mapd.push_str("435"),
100            b':' => mapd.push_str("436"),
101            b';' => mapd.push_str("437"),
102            b'<' => mapd.push_str("438"),
103            b'=' => mapd.push_str("439"),
104            b'>' => mapd.push_str("440"),
105            b'?' => mapd.push_str("441"),
106            b'@' => mapd.push_str("442"),
107            b'[' => mapd.push_str("443"),
108            b'\\' => mapd.push_str("444"),
109            b']' => mapd.push_str("445"),
110            b'^' => mapd.push_str("446"),
111            b'_' => mapd.push_str("447"),
112            b'`' => mapd.push_str("448"),
113            b'{' => mapd.push_str("449"),
114            b'|' => mapd.push_str("450"),
115            b'}' => mapd.push_str("451"),
116            b'~' => mapd.push_str("452"),
117            0 => mapd.push_str("567"),
118            1 => mapd.push_str("568"),
119            2 => mapd.push_str("569"),
120            3 => mapd.push_str("570"),
121            4 => mapd.push_str("571"),
122            5 => mapd.push_str("572"),
123            6 => mapd.push_str("573"),
124            7 => mapd.push_str("574"),
125            8 => mapd.push_str("575"),
126            9 => mapd.push_str("576"),
127            10 => mapd.push_str("577"),
128            11 => mapd.push_str("578"),
129            12 => mapd.push_str("579"),
130            13 => mapd.push_str("580"),
131            14 => mapd.push_str("581"),
132            15 => mapd.push_str("582"),
133            16 => mapd.push_str("583"),
134            17 => mapd.push_str("584"),
135            18 => mapd.push_str("585"),
136            19 => mapd.push_str("586"),
137            20 => mapd.push_str("587"),
138            21 => mapd.push_str("588"),
139            22 => mapd.push_str("589"),
140            23 => mapd.push_str("590"),
141            24 => mapd.push_str("591"),
142            25 => mapd.push_str("592"),
143            26 => mapd.push_str("593"),
144            27 => mapd.push_str("594"),
145            28 => mapd.push_str("595"),
146            29 => mapd.push_str("596"),
147            30 => mapd.push_str("597"),
148            31 => mapd.push_str("598"),
149            32 => mapd.push_str("599"),
150            33 => mapd.push_str("600"),
151            34 => mapd.push_str("601"),
152            35 => mapd.push_str("602"),
153            36 => mapd.push_str("603"),
154            37 => mapd.push_str("604"),
155            38 => mapd.push_str("605"),
156            39 => mapd.push_str("606"),
157            40 => mapd.push_str("607"),
158            41 => mapd.push_str("608"),
159            42 => mapd.push_str("609"),
160            43 => mapd.push_str("610"),
161            44 => mapd.push_str("611"),
162            45 => mapd.push_str("612"),
163            46 => mapd.push_str("613"),
164            47 => mapd.push_str("614"),
165            48 => mapd.push_str("615"),
166            49 => mapd.push_str("616"),
167            50 => mapd.push_str("617"),
168            51 => mapd.push_str("618"),
169            52 => mapd.push_str("619"),
170            53 => mapd.push_str("620"),
171            54 => mapd.push_str("621"),
172            55 => mapd.push_str("622"),
173            56 => mapd.push_str("623"),
174            57 => mapd.push_str("624"),
175            58 => mapd.push_str("625"),
176            59 => mapd.push_str("626"),
177            60 => mapd.push_str("627"),
178            61 => mapd.push_str("628"),
179            62 => mapd.push_str("629"),
180            63 => mapd.push_str("630"),
181            64 => mapd.push_str("631"),
182            65 => mapd.push_str("632"),
183            66 => mapd.push_str("633"),
184            67 => mapd.push_str("634"),
185            68 => mapd.push_str("635"),
186            69 => mapd.push_str("636"),
187            70 => mapd.push_str("637"),
188            71 => mapd.push_str("638"),
189            72 => mapd.push_str("639"),
190            73 => mapd.push_str("640"),
191            74 => mapd.push_str("641"),
192            75 => mapd.push_str("642"),
193            76 => mapd.push_str("643"),
194            77 => mapd.push_str("644"),
195            78 => mapd.push_str("645"),
196            79 => mapd.push_str("646"),
197            80 => mapd.push_str("647"),
198            81 => mapd.push_str("648"),
199            82 => mapd.push_str("649"),
200            83 => mapd.push_str("650"),
201            84 => mapd.push_str("651"),
202            85 => mapd.push_str("652"),
203            86 => mapd.push_str("653"),
204            87 => mapd.push_str("654"),
205            88 => mapd.push_str("655"),
206            89 => mapd.push_str("656"),
207            90 => mapd.push_str("657"),
208            91 => mapd.push_str("658"),
209            92 => mapd.push_str("659"),
210            93 => mapd.push_str("660"),
211            94 => mapd.push_str("661"),
212            95 => mapd.push_str("662"),
213            96 => mapd.push_str("663"),
214            97 => mapd.push_str("664"),
215            98 => mapd.push_str("665"),
216            99 => mapd.push_str("666"),
217            100 => mapd.push_str("667"),
218            101 => mapd.push_str("668"),
219            102 => mapd.push_str("669"),
220            103 => mapd.push_str("670"),
221            104 => mapd.push_str("671"),
222            105 => mapd.push_str("672"),
223            106 => mapd.push_str("673"),
224            107 => mapd.push_str("674"),
225            108 => mapd.push_str("675"),
226            109 => mapd.push_str("676"),
227            110 => mapd.push_str("677"),
228            111 => mapd.push_str("678"),
229            112 => mapd.push_str("679"),
230            113 => mapd.push_str("680"),
231            114 => mapd.push_str("681"),
232            115 => mapd.push_str("682"),
233            116 => mapd.push_str("683"),
234            117 => mapd.push_str("684"),
235            118 => mapd.push_str("685"),
236            119 => mapd.push_str("686"),
237            120 => mapd.push_str("687"),
238            121 => mapd.push_str("688"),
239            122 => mapd.push_str("689"),
240            123 => mapd.push_str("690"),
241            124 => mapd.push_str("691"),
242            125 => mapd.push_str("692"),
243            126 => mapd.push_str("693"),
244            127 => mapd.push_str("694"),
245            128 => mapd.push_str("695"),
246            129 => mapd.push_str("696"),
247            130 => mapd.push_str("697"),
248            131 => mapd.push_str("698"),
249            132 => mapd.push_str("699"),
250            133 => mapd.push_str("700"),
251            134 => mapd.push_str("701"),
252            135 => mapd.push_str("702"),
253            136 => mapd.push_str("703"),
254            137 => mapd.push_str("704"),
255            138 => mapd.push_str("705"),
256            139 => mapd.push_str("706"),
257            140 => mapd.push_str("707"),
258            141 => mapd.push_str("708"),
259            142 => mapd.push_str("709"),
260            143 => mapd.push_str("710"),
261            144 => mapd.push_str("711"),
262            145 => mapd.push_str("712"),
263            146 => mapd.push_str("713"),
264            147 => mapd.push_str("714"),
265            148 => mapd.push_str("715"),
266            149 => mapd.push_str("716"),
267            150 => mapd.push_str("717"),
268            151 => mapd.push_str("718"),
269            152 => mapd.push_str("719"),
270            153 => mapd.push_str("720"),
271            154 => mapd.push_str("721"),
272            155 => mapd.push_str("722"),
273            156 => mapd.push_str("723"),
274            157 => mapd.push_str("724"),
275            158 => mapd.push_str("725"),
276            159 => mapd.push_str("726"),
277            160 => mapd.push_str("727"),
278            161 => mapd.push_str("728"),
279            162 => mapd.push_str("729"),
280            163 => mapd.push_str("730"),
281            164 => mapd.push_str("731"),
282            165 => mapd.push_str("732"),
283            166 => mapd.push_str("733"),
284            167 => mapd.push_str("734"),
285            168 => mapd.push_str("735"),
286            169 => mapd.push_str("736"),
287            170 => mapd.push_str("737"),
288            171 => mapd.push_str("738"),
289            172 => mapd.push_str("739"),
290            173 => mapd.push_str("740"),
291            174 => mapd.push_str("741"),
292            175 => mapd.push_str("742"),
293            176 => mapd.push_str("743"),
294            177 => mapd.push_str("744"),
295            178 => mapd.push_str("745"),
296            179 => mapd.push_str("746"),
297            180 => mapd.push_str("747"),
298            181 => mapd.push_str("748"),
299            182 => mapd.push_str("749"),
300            183 => mapd.push_str("750"),
301            184 => mapd.push_str("751"),
302            185 => mapd.push_str("752"),
303            186 => mapd.push_str("753"),
304            187 => mapd.push_str("754"),
305            188 => mapd.push_str("755"),
306            189 => mapd.push_str("756"),
307            190 => mapd.push_str("757"),
308            191 => mapd.push_str("758"),
309            192 => mapd.push_str("759"),
310            193 => mapd.push_str("760"),
311            194 => mapd.push_str("761"),
312            195 => mapd.push_str("762"),
313            196 => mapd.push_str("763"),
314            197 => mapd.push_str("764"),
315            198 => mapd.push_str("765"),
316            199 => mapd.push_str("766"),
317            200 => mapd.push_str("767"),
318            201 => mapd.push_str("768"),
319            202 => mapd.push_str("769"),
320            203 => mapd.push_str("770"),
321            204 => mapd.push_str("771"),
322            205 => mapd.push_str("772"),
323            206 => mapd.push_str("773"),
324            207 => mapd.push_str("774"),
325            208 => mapd.push_str("775"),
326            209 => mapd.push_str("776"),
327            210 => mapd.push_str("777"),
328            211 => mapd.push_str("778"),
329            212 => mapd.push_str("779"),
330            213 => mapd.push_str("780"),
331            214 => mapd.push_str("781"),
332            215 => mapd.push_str("782"),
333            216 => mapd.push_str("783"),
334            217 => mapd.push_str("784"),
335            218 => mapd.push_str("785"),
336            219 => mapd.push_str("786"),
337            220 => mapd.push_str("787"),
338            221 => mapd.push_str("788"),
339            222 => mapd.push_str("789"),
340            223 => mapd.push_str("790"),
341            224 => mapd.push_str("791"),
342            225 => mapd.push_str("792"),
343            226 => mapd.push_str("793"),
344            227 => mapd.push_str("794"),
345            228 => mapd.push_str("795"),
346            229 => mapd.push_str("796"),
347            230 => mapd.push_str("797"),
348            231 => mapd.push_str("798"),
349            232 => mapd.push_str("799"),
350            233 => mapd.push_str("800"),
351            234 => mapd.push_str("801"),
352            235 => mapd.push_str("802"),
353            236 => mapd.push_str("803"),
354            237 => mapd.push_str("804"),
355            238 => mapd.push_str("805"),
356            239 => mapd.push_str("806"),
357            240 => mapd.push_str("807"),
358            241 => mapd.push_str("808"),
359            242 => mapd.push_str("809"),
360            243 => mapd.push_str("810"),
361            244 => mapd.push_str("811"),
362            245 => mapd.push_str("812"),
363            246 => mapd.push_str("813"),
364            247 => mapd.push_str("814"),
365            248 => mapd.push_str("815"),
366            249 => mapd.push_str("816"),
367            250 => mapd.push_str("817"),
368            251 => mapd.push_str("818"),
369            252 => mapd.push_str("819"),
370            253 => mapd.push_str("820"),
371            254 => mapd.push_str("821"),
372            255 => mapd.push_str("822"),
373
374            _ => {}
375        }
376    }
377    let mapppd = mapd.clone();
378    let bid = mapppd.to_owned().clone();
379    let mappd = bid.as_bytes();
380    return mappd.to_vec();
381    //println!("{}", mapd);
382}
383
384pub fn decrypt(file: &str) -> Vec<u8> {
385    let mut decrypted_data: Vec<u8> = Vec::new();
386    let encrypted_file = file.trim().trim_matches('\"').trim_matches('\'');
387    let mut openf = File::open(encrypted_file).unwrap();
388    let mut encrypted_data = Vec::new();
389    openf.read_to_end(&mut encrypted_data).unwrap();
390    let mut parts = encrypted_data.splitn(2, |&x| {
391        x == b'|' && encrypted_data.get(1) == Some(&b'|') && encrypted_data.get(2) == Some(&b'|')
392    });
393    let passworrd = parts.next().unwrap_or(&[]);
394    let passworrd = String::from_utf8_lossy(passworrd);
395    let mut passwordndencdat = passworrd.split("-_-");
396    let encrypted_data = passwordndencdat.next().unwrap_or("").trim().as_bytes();
397    //let encrypted_data = parts.next().unwrap_or(&[]);
398    for chunk in encrypted_data.chunks(3) {
399        if let [first, second, third] = chunk {
400            let num_str = format!("{}{}{}", *first as char, *second as char, *third as char);
401            let num: u16 = num_str.parse().unwrap();
402            match num {
403                100 => decrypted_data.push(b'A'),
404                101 => decrypted_data.push(b'B'),
405                102 => decrypted_data.push(b'C'),
406                103 => decrypted_data.push(b'D'),
407                104 => decrypted_data.push(b'E'),
408                105 => decrypted_data.push(b'F'),
409                106 => decrypted_data.push(b'G'),
410                107 => decrypted_data.push(b'H'),
411                108 => decrypted_data.push(b'I'),
412                109 => decrypted_data.push(b'J'),
413                110 => decrypted_data.push(b'K'),
414                111 => decrypted_data.push(b'L'),
415                112 => decrypted_data.push(b'M'),
416                113 => decrypted_data.push(b'N'),
417                114 => decrypted_data.push(b'O'),
418                115 => decrypted_data.push(b'P'),
419                116 => decrypted_data.push(b'Q'),
420                117 => decrypted_data.push(b'R'),
421                118 => decrypted_data.push(b'S'),
422                119 => decrypted_data.push(b'T'),
423                120 => decrypted_data.push(b'U'),
424                121 => decrypted_data.push(b'V'),
425                122 => decrypted_data.push(b'W'),
426                123 => decrypted_data.push(b'X'),
427                124 => decrypted_data.push(b'Y'),
428                125 => decrypted_data.push(b'Z'),
429                200 => decrypted_data.push(b'a'),
430                201 => decrypted_data.push(b'b'),
431                202 => decrypted_data.push(b'c'),
432                203 => decrypted_data.push(b'd'),
433                204 => decrypted_data.push(b'e'),
434                205 => decrypted_data.push(b'f'),
435                206 => decrypted_data.push(b'g'),
436                207 => decrypted_data.push(b'h'),
437                208 => decrypted_data.push(b'i'),
438                209 => decrypted_data.push(b'j'),
439                210 => decrypted_data.push(b'k'),
440                211 => decrypted_data.push(b'l'),
441                212 => decrypted_data.push(b'm'),
442                213 => decrypted_data.push(b'n'),
443                214 => decrypted_data.push(b'o'),
444                215 => decrypted_data.push(b'p'),
445                216 => decrypted_data.push(b'q'),
446                217 => decrypted_data.push(b'r'),
447                218 => decrypted_data.push(b's'),
448                219 => decrypted_data.push(b't'),
449                220 => decrypted_data.push(b'u'),
450                221 => decrypted_data.push(b'v'),
451                222 => decrypted_data.push(b'w'),
452                223 => decrypted_data.push(b'x'),
453                224 => decrypted_data.push(b'y'),
454                225 => decrypted_data.push(b'z'),
455                150 => decrypted_data.push(b'0'),
456                151 => decrypted_data.push(b'1'),
457                152 => decrypted_data.push(b'2'),
458                153 => decrypted_data.push(b'3'),
459                154 => decrypted_data.push(b'4'),
460                155 => decrypted_data.push(b'5'),
461                156 => decrypted_data.push(b'6'),
462                157 => decrypted_data.push(b'7'),
463                158 => decrypted_data.push(b'8'),
464                159 => decrypted_data.push(b'9'),
465                999 => decrypted_data.push(b'\n'),
466                898 => decrypted_data.push(b' '),
467                421 => decrypted_data.push(b'!'),
468                422 => decrypted_data.push(b'"'),
469                423 => decrypted_data.push(b'#'),
470                424 => decrypted_data.push(b'$'),
471                425 => decrypted_data.push(b'%'),
472                426 => decrypted_data.push(b'&'),
473                427 => decrypted_data.push(b'\''),
474                428 => decrypted_data.push(b'('),
475                429 => decrypted_data.push(b')'),
476                430 => decrypted_data.push(b'*'),
477                431 => decrypted_data.push(b'+'),
478                432 => decrypted_data.push(b','),
479                433 => decrypted_data.push(b'-'),
480                434 => decrypted_data.push(b'.'),
481                435 => decrypted_data.push(b'/'),
482                436 => decrypted_data.push(b':'),
483                437 => decrypted_data.push(b';'),
484                438 => decrypted_data.push(b'<'),
485                439 => decrypted_data.push(b'='),
486                440 => decrypted_data.push(b'>'),
487                441 => decrypted_data.push(b'?'),
488                442 => decrypted_data.push(b'@'),
489                443 => decrypted_data.push(b'['),
490                444 => decrypted_data.push(b'\\'),
491                445 => decrypted_data.push(b']'),
492                446 => decrypted_data.push(b'^'),
493                447 => decrypted_data.push(b'_'),
494                448 => decrypted_data.push(b'`'),
495                449 => decrypted_data.push(b'{'),
496                450 => decrypted_data.push(b'|'),
497                451 => decrypted_data.push(b'}'),
498                452 => decrypted_data.push(b'~'),
499                567 => decrypted_data.push(0),
500                568 => decrypted_data.push(1),
501                569 => decrypted_data.push(2),
502                570 => decrypted_data.push(3),
503                571 => decrypted_data.push(4),
504                572 => decrypted_data.push(5),
505                573 => decrypted_data.push(6),
506                574 => decrypted_data.push(7),
507                575 => decrypted_data.push(8),
508                576 => decrypted_data.push(9),
509                577 => decrypted_data.push(10),
510                578 => decrypted_data.push(11),
511                579 => decrypted_data.push(12),
512                580 => decrypted_data.push(13),
513                581 => decrypted_data.push(14),
514                582 => decrypted_data.push(15),
515                583 => decrypted_data.push(16),
516                584 => decrypted_data.push(17),
517                585 => decrypted_data.push(18),
518                586 => decrypted_data.push(19),
519                587 => decrypted_data.push(20),
520                588 => decrypted_data.push(21),
521                589 => decrypted_data.push(22),
522                590 => decrypted_data.push(23),
523                591 => decrypted_data.push(24),
524                592 => decrypted_data.push(25),
525                593 => decrypted_data.push(26),
526                594 => decrypted_data.push(27),
527                595 => decrypted_data.push(28),
528                596 => decrypted_data.push(29),
529                597 => decrypted_data.push(30),
530                598 => decrypted_data.push(31),
531                599 => decrypted_data.push(32),
532                600 => decrypted_data.push(33),
533                601 => decrypted_data.push(34),
534                602 => decrypted_data.push(35),
535                603 => decrypted_data.push(36),
536                604 => decrypted_data.push(37),
537                605 => decrypted_data.push(38),
538                606 => decrypted_data.push(39),
539                607 => decrypted_data.push(40),
540                608 => decrypted_data.push(41),
541                609 => decrypted_data.push(42),
542                610 => decrypted_data.push(43),
543                611 => decrypted_data.push(44),
544                612 => decrypted_data.push(45),
545                613 => decrypted_data.push(46),
546                614 => decrypted_data.push(47),
547                615 => decrypted_data.push(48),
548                616 => decrypted_data.push(49),
549                617 => decrypted_data.push(50),
550                618 => decrypted_data.push(51),
551                619 => decrypted_data.push(52),
552                620 => decrypted_data.push(53),
553                621 => decrypted_data.push(54),
554                622 => decrypted_data.push(55),
555                623 => decrypted_data.push(56),
556                624 => decrypted_data.push(57),
557                625 => decrypted_data.push(58),
558                626 => decrypted_data.push(59),
559                627 => decrypted_data.push(60),
560                628 => decrypted_data.push(61),
561                629 => decrypted_data.push(62),
562                630 => decrypted_data.push(63),
563                631 => decrypted_data.push(64),
564                632 => decrypted_data.push(65),
565                633 => decrypted_data.push(66),
566                634 => decrypted_data.push(67),
567                635 => decrypted_data.push(68),
568                636 => decrypted_data.push(69),
569                637 => decrypted_data.push(70),
570                638 => decrypted_data.push(71),
571                639 => decrypted_data.push(72),
572                640 => decrypted_data.push(73),
573                641 => decrypted_data.push(74),
574                642 => decrypted_data.push(75),
575                643 => decrypted_data.push(76),
576                644 => decrypted_data.push(77),
577                645 => decrypted_data.push(78),
578                646 => decrypted_data.push(79),
579                647 => decrypted_data.push(80),
580                648 => decrypted_data.push(81),
581                649 => decrypted_data.push(82),
582                650 => decrypted_data.push(83),
583                651 => decrypted_data.push(84),
584                652 => decrypted_data.push(85),
585                653 => decrypted_data.push(86),
586                654 => decrypted_data.push(87),
587                655 => decrypted_data.push(88),
588                656 => decrypted_data.push(89),
589                657 => decrypted_data.push(90),
590                658 => decrypted_data.push(91),
591                659 => decrypted_data.push(92),
592                660 => decrypted_data.push(93),
593                661 => decrypted_data.push(94),
594                662 => decrypted_data.push(95),
595                663 => decrypted_data.push(96),
596                664 => decrypted_data.push(97),
597                665 => decrypted_data.push(98),
598                666 => decrypted_data.push(99),
599                667 => decrypted_data.push(100),
600                668 => decrypted_data.push(101),
601                669 => decrypted_data.push(102),
602                670 => decrypted_data.push(103),
603                671 => decrypted_data.push(104),
604                672 => decrypted_data.push(105),
605                673 => decrypted_data.push(106),
606                674 => decrypted_data.push(107),
607                675 => decrypted_data.push(108),
608                676 => decrypted_data.push(109),
609                677 => decrypted_data.push(110),
610                678 => decrypted_data.push(111),
611                679 => decrypted_data.push(112),
612                680 => decrypted_data.push(113),
613                681 => decrypted_data.push(114),
614                682 => decrypted_data.push(115),
615                683 => decrypted_data.push(116),
616                684 => decrypted_data.push(117),
617                685 => decrypted_data.push(118),
618                686 => decrypted_data.push(119),
619                687 => decrypted_data.push(120),
620                688 => decrypted_data.push(121),
621                689 => decrypted_data.push(122),
622                690 => decrypted_data.push(123),
623                691 => decrypted_data.push(124),
624                692 => decrypted_data.push(125),
625                693 => decrypted_data.push(126),
626                694 => decrypted_data.push(127),
627                695 => decrypted_data.push(128),
628                696 => decrypted_data.push(129),
629                697 => decrypted_data.push(130),
630                698 => decrypted_data.push(131),
631                699 => decrypted_data.push(132),
632                700 => decrypted_data.push(133),
633                701 => decrypted_data.push(134),
634                702 => decrypted_data.push(135),
635                703 => decrypted_data.push(136),
636                704 => decrypted_data.push(137),
637                705 => decrypted_data.push(138),
638                706 => decrypted_data.push(139),
639                707 => decrypted_data.push(140),
640                708 => decrypted_data.push(141),
641                709 => decrypted_data.push(142),
642                710 => decrypted_data.push(143),
643                711 => decrypted_data.push(144),
644                712 => decrypted_data.push(145),
645                713 => decrypted_data.push(146),
646                714 => decrypted_data.push(147),
647                715 => decrypted_data.push(148),
648                716 => decrypted_data.push(149),
649                717 => decrypted_data.push(150),
650                718 => decrypted_data.push(151),
651                719 => decrypted_data.push(152),
652                720 => decrypted_data.push(153),
653                721 => decrypted_data.push(154),
654                722 => decrypted_data.push(155),
655                723 => decrypted_data.push(156),
656                724 => decrypted_data.push(157),
657                725 => decrypted_data.push(158),
658                726 => decrypted_data.push(159),
659                727 => decrypted_data.push(160),
660                728 => decrypted_data.push(161),
661                729 => decrypted_data.push(162),
662                730 => decrypted_data.push(163),
663                731 => decrypted_data.push(164),
664                732 => decrypted_data.push(165),
665                733 => decrypted_data.push(166),
666                734 => decrypted_data.push(167),
667                735 => decrypted_data.push(168),
668                736 => decrypted_data.push(169),
669                737 => decrypted_data.push(170),
670                738 => decrypted_data.push(171),
671                739 => decrypted_data.push(172),
672                740 => decrypted_data.push(173),
673                741 => decrypted_data.push(174),
674                742 => decrypted_data.push(175),
675                743 => decrypted_data.push(176),
676                744 => decrypted_data.push(177),
677                745 => decrypted_data.push(178),
678                746 => decrypted_data.push(179),
679                747 => decrypted_data.push(180),
680                748 => decrypted_data.push(181),
681                749 => decrypted_data.push(182),
682                750 => decrypted_data.push(183),
683                751 => decrypted_data.push(184),
684                752 => decrypted_data.push(185),
685                753 => decrypted_data.push(186),
686                754 => decrypted_data.push(187),
687                755 => decrypted_data.push(188),
688                756 => decrypted_data.push(189),
689                757 => decrypted_data.push(190),
690                758 => decrypted_data.push(191),
691                759 => decrypted_data.push(192),
692                760 => decrypted_data.push(193),
693                761 => decrypted_data.push(194),
694                762 => decrypted_data.push(195),
695                763 => decrypted_data.push(196),
696                764 => decrypted_data.push(197),
697                765 => decrypted_data.push(198),
698                766 => decrypted_data.push(199),
699                767 => decrypted_data.push(200),
700                768 => decrypted_data.push(201),
701                769 => decrypted_data.push(202),
702                770 => decrypted_data.push(203),
703                771 => decrypted_data.push(204),
704                772 => decrypted_data.push(205),
705                773 => decrypted_data.push(206),
706                774 => decrypted_data.push(207),
707                775 => decrypted_data.push(208),
708                776 => decrypted_data.push(209),
709                777 => decrypted_data.push(210),
710                778 => decrypted_data.push(211),
711                779 => decrypted_data.push(212),
712                780 => decrypted_data.push(213),
713                781 => decrypted_data.push(214),
714                782 => decrypted_data.push(215),
715                783 => decrypted_data.push(216),
716                784 => decrypted_data.push(217),
717                785 => decrypted_data.push(218),
718                786 => decrypted_data.push(219),
719                787 => decrypted_data.push(220),
720                788 => decrypted_data.push(221),
721                789 => decrypted_data.push(222),
722                790 => decrypted_data.push(223),
723                791 => decrypted_data.push(224),
724                792 => decrypted_data.push(225),
725                793 => decrypted_data.push(226),
726                794 => decrypted_data.push(227),
727                795 => decrypted_data.push(228),
728                796 => decrypted_data.push(229),
729                797 => decrypted_data.push(230),
730                798 => decrypted_data.push(231),
731                799 => decrypted_data.push(232),
732                800 => decrypted_data.push(233),
733                801 => decrypted_data.push(234),
734                802 => decrypted_data.push(235),
735                803 => decrypted_data.push(236),
736                804 => decrypted_data.push(237),
737                805 => decrypted_data.push(238),
738                806 => decrypted_data.push(239),
739                807 => decrypted_data.push(240),
740                808 => decrypted_data.push(241),
741                809 => decrypted_data.push(242),
742                810 => decrypted_data.push(243),
743                811 => decrypted_data.push(244),
744                812 => decrypted_data.push(245),
745                813 => decrypted_data.push(246),
746                814 => decrypted_data.push(247),
747                815 => decrypted_data.push(248),
748                816 => decrypted_data.push(249),
749                817 => decrypted_data.push(250),
750                818 => decrypted_data.push(251),
751                819 => decrypted_data.push(252),
752                820 => decrypted_data.push(253),
753                821 => decrypted_data.push(254),
754                822 => decrypted_data.push(255),
755
756                _ => {}
757            }
758        }
759    }
760    let instr = String::from_utf8_lossy(&decrypted_data);
761    return instr.as_bytes().to_vec();
762}
763
764#[cfg(test)]
765mod tests {
766    use crate::{decrypt, encrypt};
767
768    #[test]
769    fn tst_en() {
770        let encdat = encrypt("./tst_enc.txt");
771        println!("{:?}",encdat);
772    }
773    #[test]
774    fn tst_den() {
775        let dencdat = decrypt("./1_dec_tst.neko");
776        if dencdat == 1.to_string().as_bytes().to_vec(){
777            println!("EERRR");
778        }
779        println!("{:?}",dencdat);
780    }
781    
782}