Come up with an encryption/decryption mechanism.
The program runs with one of the following sets of arguments:
-e fileName fileOutputName
-d fileName fileOutputName
where:
fileName is the name of a file to be encrypted/decrypted.
fileOutputName is the name of the file where you need to write the re
Encryption
- 10
Locked
Comments (16)
- Popular
- New
- Old
You must be signed in to leave a comment
Anonymous #11688642
22 September 2025, 17:39
Anyone coming from other languages who's used to stuff like leetcode is likely going to feel a bit silly here. I went with a sequence of <character's ascii value encoded as a string>[<count encoded as a string>] prefaced with a single E in case something needed to be done for empty files too. Turns out something like the Caesar Cipher is more than enough for this problem.
0
Hoist
9 January 2024, 06:15
go with a simple encryption/decryption mechanism that uses the Caesar Cipher algorithm. The Caesar Cipher is a substitution cipher that replaces each letter in the plaintext with a letter a fixed number of positions down the alphabet. --- The mode variable specifies whether to encrypt or decrypt the data. --- The shift variable specifies the number of positions to shift the letters in the Caesar Cipher.
0
matemate123
25 January 2023, 14:31
It's good that I remembered lesson from Java Syntax zero.
You can look, on
Java Syntax Zero
Level 9, Lesson 6
Bitwise operations, part 2 -> 4.Encryption
Rest is like always on this chapter ;)
+2
Олег БайбулаExpert
20 February 2023, 13:52
Thank you, could not get it because, I'd skipped Bitwise lessons. 😁
+1
Justin Smith
7 October 2021, 14:05
If you got to this task and panicked like I did "OMG they didn't teach us anything about encryption yet"
relax
It's not real encryption. It would help if they said "Don't use any of Java's encryption classes. Just convert each byte to another byte, and be able to do this process in reverse."
0
Jurij Thmsn
13 April 2021, 15:50
Make sure you take "-e" and "-d" as arguments, not "e" and "d" !
0
Bartlomiej Drozd
22 February 2021, 21:24
470
0
Isma Java Developer
30 December 2020, 09:28
To those who got confused by "encryption/decryption mechanism". You can create your own mechanism:
is an encryption mechanism.
The analogous decryption mechanism would be
+1
Nyerges Ferenc
8 November 2020, 13:35
Cool task :-) Passed for 2nd ( I should have remembered the difference between i++ and ++i :-) )
0
Seferi
18 October 2020, 19:36
This task was a lot of fun!
0
Agent Smith
5 September 2020, 18:08
Wow, only 364 people managed to do this task by September 2020. Lowest I've seen so far!
I'll leave a small hint: Caesar cipher
It might look complicated to do at first, but in fact it is much easier to apply with files than with letters.
+3
Sela
18 September 2020, 10:24
no of completions: 376 by now
+2
Andrei
28 January 2021, 08:55
455 today.
0
Youssef Amajout Talidni Future Java DEV
31 October 2023, 10:31
31 oct 2023 : 847 people
+1