You are browsing as a guest. Sign up (or log in) to start making projects!

encrypted text editor

  • 3 Devlogs
  • 4 Total hours

kinda like those key locked diaries. implementing AES-GCM and PBKDF2 from the ground up for the sake of better understanding encryption and key derivation algorithms

Open comments for this post

2h 20m 12s logged

spent about an hour writing the process of setting up plaintext for AES, but then as i tested it, i realized i hadn’t accounted for all edge cases and hadn’t written very efficient or elegant code so I decided to take a step back, write out the process on paper, and then rewrite the methods. Here’s that:

plaintext (string) -> binary equivalent with space between each byte (string) -> add trailing zeros to binary string to make the number of bits divisible by 128 to make full blocks without errors -> create an array of each byte in the binary equivalent string (string[]) -> create an array of 128 bit (4x4 byte) blocks, organizing the bytes from the previous string[] in column-major order into each block (string[][][])

having it clearly written out and having already experimented with it, i was able to write cleaner code by writing a method for each step of this process, each taking the lasts output as input, and then writing a final method which executes each of these methods in the correct order, turning plain text into the necessary blocks of binary data. I have attached this method below as I figure the rest of the code is too long to show and this project doesn’t really have any cool graphics to showcase yet.

next, i have to figure out how to generate salts and write a key generation function. alternatively, i could also take a break from the encryption/decryption aspect of this project and figure out the file management system, since i’ve never worked with that before, or i could also get started on the ui.

0
0
12
Open comments for this post

59m 44s logged

after reading up a little more on AES and still not fully understanding all of the processes I’ll need to implement, I figured I should just start writing the parts I do know I’ll need.
I wrote a method that converts a string of plain text to a string of it’s binary equivalent, then another that splits that string of binary into bytes (every 3 digits) and adds each one to an array, and another that prints it in a readable manner for testing purposes.
I’m still not done implementing the binary string to byte[] function as I just realized that the reason the byte variable type has 3 digits and not 4 is because it is not encoded in binary and I did not account for that in my code. I have a feeling I might find more systemic errors and/or redundancies in my code tomorrow as I’ve barely touched java (or coding for that matter) for 2 years, but I’ll work through them tomorrow and then move on the next step, which I believe is turning that 1D byte array into a 2D 4x4 column-major byte array for each 128 bits of text being encrypted.

0
0
9
Open comments for this post

34m 6s logged

Today I set up a brand new Github account, made a repository for this project, and connected it with VScode. I settled on using Java over Python, since I figured I needed a refresher after taking AP CSA 2 years ago. Then I spent about an hour researching encryption algorithms. Attached is my best understanding of how the encryption should be implemented/will work.

0
0
57

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…