Hello, everyone! This post will be about encryption, because why not. So, lets talk about multiple types of encryption, of which there are 3 main ones. 1) One direction only encryption (aka. hash) This type of encryption, also commonly known as hash, is made to work in one direction only, however its not always the case(they can sometimes eventually be cracked). It commonly involves manipulating bitcount in strange ways until you get a result thats so "random" that it only belongs to that specific piece of data, and is so hard to get back the best bet is to try and guess all strings in some kind of password list. This is also not always used only to encrypt data however, and is also used in form of SHA1 in git, where its determining if the same blob already exists in the project. 2) Two directional decryption using 1 key This type is using one key, and its propably the simpliest of all encryption types to make algorithm on. For our example we can say our algorithm will be they key will be 1 integer number, and when we need to encypt, we will multiply by it, and if we need to decrypt, simply divide by it. This is obviously very oversimplified, bad and insecure algorithm, but lets try it anyway, shall we? So, lets define the data as an array of ints: data = `{9, 5, -2, 10, -5, 2}` and now our key: `key = 6;` And now, if we encrypt the data with some c# linq code: `var encrypted = data.Select(x => x * key);` And after printing newData, we get the encrypted data, therefore: {54, 30, -12, 60, -30, 12} And then we can simply decrypt it back: `var data = encrypted.Select(x => x / key);` And we get the same result as the original data! 3) Bi-Directional keypair encryption This encryption is used preety much everywhere, and it uses something called cryptographic keypair, which consists of public and private key. Public key allows you to encrypt the data, which you can later decrypt using private key, but not using the public one. This makes it very useful, but very hard to make a good algorithm on. And so, how does it work? Let me show you, using the RSA algorithm implementation. First of all, you will need to generate 2 prime numbers, and about 300digits on both should be secure, and lets call them p and q, therefore: let p = random_prime(digits: 300); let q = random_prime(digits: 300); After we have this, we have to make totient, and few other numbers, like this: let n = p * q; let t = (p - 1) * (q - 1); Now, we have to choose a random integer e thats between 1 and t (and commonly below 2^16 aswell), something like this should work: let e = rand() % (t % pow(2, 16)); This is also our encryption key, and now we have to generate the decryption key, which is just inverse modulo(e, t), so: let d = mod_inv(e, t); If the mod_inv succeeds(the result isn't -1 in most implementations), it means our algorithm worked. Now, we can try to encrypt and decrypt a message, using already, a very simple calculation: let data : ulong = 'H' | 'e' | 'l' | 'l' | 'o'; let encrypted = pow(data, e) % n; and then to decrypt: let decrypted = pow(encrypted, d) % n; And here you go! Anyway, that'd be it for today, hope you enjoyed!