About
Hello my name is Korosium and this is my portfolio! I learned many things during my time in college. One of those was programming. I always liked mathematics and it's quirks. One of them was how it is used in our daily lives on the internet. One technology I came to obsessed over was the world of hash functions. There is something quite charming about them. For once it's always the same length output for a given function and you never know what digest you will get with one of them. I love the simplicity behind most of them and how simple operations over multiple rounds gives us something to check if our files were successfully transfered and if the deposit at my bank was valid or not. Another thing that fascinated me about the world of numbers was their use in encryption algorithms also known as ciphers. I love the fact that with a given key someone can take some important data, create something that looks gibberish and without order, do the reverse operation and BOOM! you get the original data back. Even as of today, with me knowing the ins and outs of many ciphers I still find it magical. So yeah that sums it up. I love cryptography and online safety. My favorite languages are Python and JavaScript for their ease of use and many projects built with them. Speaking of, the next section is dedicated to some of my personal works over the year when I learned about the world of cryptography on my own.
My Projects
Here are all my public projects hosted on GitHub Pages. Except for Bootstrap, every other logical file like the MD5 algorithm, SHA-1 algorithm, AES cipher, ChaCha20-Poly1305 cipher and many more were all implemented by me in JavaScript. I wanted to challenge myself and not take already existing implementations of said algorithm so I reimplemented them one by one to learn them in dept and that helped me greatly in my understanding of the crypto world.
---
Erosion
My favorite page yet. Used to encrypt and decrypt text and files alike. The user can choose between the AES, ChaCha20-Poly1305 and XChaCha20-Poly1305 cipher. For the key formating the user can choose between the SHA-256, SHA-256d and SHA3-256 hash algorithm.
When the user encrypts some text, the encoding chosen in the settings will be used to encode the ciphertext. The user can take an already encrypted string and as long as they have the key they will be able to decrypt it. The page uses a certain "bruteforce" feature to check which encoding was used to encrypt the text and if all fails that means the key was not the right one.
My most prized feature of the site is to encrypt files. The user can take any plaintext file (Text, Music, Video) and the page will encrypt it with the .ero extension. This is how the process works:
Magic Number
First off, the Magic Number. Every encrypted ero file will have the
following magic number as the first 7 bytes: 45524f53494f4e which means EROSION in all caps in
hexadecimal.
Algorithm Used
This single byte as a lot of utilities, the first 4 bits indicates
which cipher was used to encrypt the file:
| Algorithm | Bits | Hex |
|---|---|---|
| ChaCha20-Poly1305 | 0011 | 3 |
| AES-256-CBC-HMAC-SHA-256 | 0110 | 6 |
| XChaCha20-Poly1305 | 1100 | c |
And the last 4 bits indicates which hash algorithm was used to format the key:
| Algorithm | Bits | Hex |
|---|---|---|
| SHA-256 | 0011 | 3 |
| SHA-256d | 0110 | 6 |
| SHA3-256 | 1100 | c |
This means that their are 9 possible combination of ciphers and hash algorithms:
| Algorithm | Bits | Hex |
|---|---|---|
| ChaCha20-Poly1305 + SHA-256 | 00110011 | 33 |
| ChaCha20-Poly1305 + SHA-256d | 00110110 | 36 |
| ChaCha20-Poly1305 + SHA3-256 | 00111100 | 3c |
| AES-256-CBC-HMAC-SHA-256 + SHA-256 | 01100011 | 63 |
| AES-256-CBC-HMAC-SHA-256 + SHA-256d | 01100110 | 66 |
| AES-256-CBC-HMAC-SHA-256 + SHA3-256 | 01101100 | 6c |
| XChaCha20-Poly1305 + SHA-256 | 11000011 | c3 |
| XChaCha20-Poly1305 + SHA-256d | 11000110 | c6 |
| XChaCha20-Poly1305 + SHA3-256 | 11001100 | cc |
Nonce
The Number used once's length is based on the cipher algorithm used:
| Algorithm | Bytes |
|---|---|
| ChaCha20-Poly1305 | 12 |
| AES-256-CBC-HMAC-SHA-256 | 16 |
| XChaCha20-Poly1305 | 24 |
Tag
The tag is always 16 bytes long for all ciphers used. It is used to check if the
key provided by the user is the right one for decryption. If the calculated tag with the provided key isn't
the same as the received tag, the page won't decrypt the file. It's either the key that is wrong or that the
file was corrupted or tempered with in any way.
Ciphertext
Finally, the ciphertext is where the actual file is encrypted. Just before
the encryption process we take the file name length (up to 256 bytes) take it and assigns it to the first
byte that we will later encrypt. Immediately after we encode the filename in bytes and place it after the
filename length. And after that it's the file data that's being parsed and we are able to encrypt the whole
file. What's fun with this approach is that we can rename the encrypted file to another filename if we want
added privacy. Upon decryption, the stored filename in the ciphertext will be used to get the original name
back.
Conclusion
All the above steps can be described by this pattern below:
Hash
A page used to hash text and files alike with either the MD5, SHA-1, the SHA-2 family or the SHA-3 family of hash functions.
Minimize
A page used to minimize JavaScript files and also convert images to a Base64 variant for implementation in other pages to reduce space used.
Image to Braille
A page used to convert images to it's Braille equivalent.
Password Generator
A page used to generate secure password. The user has the choice to put it's desired special characters and password length.
Conversion
Convert any text base encoding to other encoding.
Included encodings are: UTF-8, Binary,
Octal, Decimal, Hex, Base64, Base32 and Morse code
Scripts
The page that hosts all the JavaScript implementation I've made over the years for the projects above.