Sunday, December 7, 2014

Encrypted paragraphs in this blog are now a thing

If you're going through my blog posts and happen to chance across a paragraph of what appears to be complete nonsensical gibberish, keep your cool. That was a paragraph encrypted with the Advanced Encryption Standard (or AES) with a secret key specific to that post.

In case you've come here directly from a post that has such an encrypted paragraph, then know that the only way you can view that content is by having the right key. Simply use an AES decrypter tool (if I haven't included one in the paragraph already), and then copy paste the text, input the key and run the tool. You may need to decode the text from base64 which I use in my encrypted paragraphs to prevent character encoding problems.
If you're looking for such a tool, you should know that there are several online websites for this. Just give Google a try sometimes, you lazy buffoon.
Keep in mind that if you don't have the right key (the secret bit of text used to encrypt the paragraph and will generate the right cleartext when used while decrypting), then there is little sense in trying this.
The key is specific to the post that contains the paragraph. This means that all paragraphs in one post can be decrypted using the same key, but if two paragraphs exist in different posts on this blog, they will require different keys for successful decryption.

This idea first hit me when a friend of mine did something similar in his own blog.
I realized that when I write posts that include my perspective in general, there's often something I need to include that's personal, offensive, immature or in any other way just unsuitable for my general audience to view.
This could include anything from a rant about how I secretly hate my girlfriend's sister, to a note that I want my future self to read.

So why don't you entirely just hide the paragraph instead, Arvind?
Because I want to let the readers know that whatever legible text they can read, isn't the entire story.
That there is more that needs to be said about what I've written, but at the same time isn't meant for everyone to see.
I want to let the readers know that however astronomical, they have the chance to use the right key and decrypt that paragraph so they can take a look.

Also, to keep things more organized, and for the sake of my own convenience, I've labelled every post that has an encrypted paragraph with the "hidden content" tag.

In fact, to get things rolling already, here's an encrypted paragraph where I write about how I feel about this approach to hide inappropriate content. Since this is a sample, the key to decrypt this is "ogodplswork". Do not expect me to give away the key for any future content that I really wish to hide.

DiOogyrmMwb5IcfyNQjWQ6pXBGKY0ujIKAN761vfZPuRWg/EIg5JkyHLKw/2ULjN5fRkChq3qx/c6+Kv6TonE48T+eHiU6SXm1l4+4raT8Vh5I5YEptBm3VulLvjghT7x1i+KCXOe3CWor5QsIcCgrH9Hp/1RxBOhC2zJhUDPgRxOz2xb5z13LyrAtEELqdjYRlC128eqscsEBWQV00eTAvnNVuoa+8c2Q+edP4C6cZFZArOyUuVglSNmD1pJ7j2f1MgRilgoUQUA7t7n4mkbVuZxl2ZVp/ksnYtr8agIc2f5BLRa1Xe3qj9cKaRkXDAo6QCCvoomrgAA15if9GlVrgemxeun3UNcOH/a7z4WmxaueP3Z8FygT50Zd3oSFlGaunkFwvtr5g5v21IypkUrMPoYjYcCXQEveTWKE+Bng5ayVFCs9ca+soWNS6IvpWiITv4H+KUGsiXSue0vGSlAn7yzu4hFqv0fsSMEIl/xRzuZECPgYST9LRv6kKB71asNc/eKJMaBOFkIozMzudeZEPGsOGRCvsPoDGseSjXhdc5GOgbYZec6DlUSapGR0fcrgY5zmaBIERaxmN5cRX2tNQFTUYssjs/BYrvmsUpu0Ay9tEMNsjFlTVg3uTMvlSgAbPOws8HHbJ2ebk7iU/L4fdOVc0FuFCbuQbfVa/K7fcFAEOaxrVSOJRr8AELDi9iPp4s18H8zFw/dC+aMn0PT6qbOP4IMjiySW416V1afRdddoj122yFwPN3injTkvSoY+L1FBMOvt1EHp3DhtL7diEvHWspvDeGDGhDkeaPgLqzHVTG8JLnZUUPBGq+TOaXaH4KugbVcleZFJadptWytiP5iXrzXn8h8iXDTMyGgZkYlsw1UDY+CQK5hhCPDAf7dAxfbUHShfFxGJktgACbMUEY/K1OtmhzrrT2CYhCSs2EqpDZQJmih5xtB+d4e+xflTIMsZREI1Bjo1FmJ5mZjy4Ro70qHJGHjfsRmB7vzB6yduBnSy5NcP5WOw9wBP7qgotPfc8z6RJI+FZDJ0tQ3iKU3FBzbTKjvoMXmCCXz0nTWtAm2k69GPwAsYATdC0KcT+prTHcycgcwy6S75q0z7nIs8pfwkYuqHcKZVShX/wSWTpBuimMC+u6fMGFckyj7o218poMJwVaOmiSUuoaGg==

Here's another encrypted paragraph. Keys are specific to the post they are in. So the same key should work here too. Try it.

dNx17tL2eSRl+6UyLrd0qsBbQX8iiOnNyxUgfKx5U4ZDWbwr0XnC20NHGGSGL4IQhfjwynAW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G0Eb9pKRBuvSZLmtrr0Klkx+xOZdjARniPRb/TNU2MGQnQpYzgFJbhbTm1hXx1ul+yj/DPzF2qsyA6L0t9Zqm0Z+pjgvznYRblyY8iIsRu3xCHbr8zeE70v7RANsPH+Ijjk8ZKUnuIVt1SwceEGpb9RxYKnkw/gdpV5Fx4+sDz09+s/i/KrKRPGic+zei5S/I3Ngj6KDlZ8APuas6pPX1OIS5q4S7tELHM+hlr/L19uX4z2vSKRmAHsJn/kr2B3uV7Bazhz5vTvSamFW9gI2gQT/SxRkihYavdz+Vbi0eQIYREzKiRHEXmPlwGkISIi6/N7Y5DrVXVO3T4I8P/hKI28SXdrtI+i+jjMA5SG0evKnnw12zaUv6YpRaZcarg88CEGonZtDre2yUPNvCkQFacN3ggoSu1A+kj3GdQPoQlxL1muRU0mNw20pBKi05iQTMq67ZdGLpe8G5A5wKzcccy/TpYGUqoVpVxwrUrMo89W5a70JQUoy0HeNnk7OaVUQSc8B8pVGnjfMkqiypAfO6jLUojSQd3v+on+WZ3EhJNlmwEXmBZ3VkETw8ovejjDn7GkCSwozjlExtc+W/02YTzex5XVnBT3fOZeFULyXih/JQmKZ0ZSi7Dy3onlj0MyQlEGF/AHh81zSXiE0W7okjjrMpCqokibcvQWNET0muKEocDsWSfnK4N95swOFI8z3wJGMj/brsPfdhNqUxMlK5gZe4aEaCPb9c38o+e8jvOgiW2Jg/BO817mGD9YQT9ay0tcU94zxLEGnw==

Friday, November 28, 2014

Running a craftbukkit minecraft server for less than 512MB of RAM

Note: This post is not for those looking to run a server on a Raspberry Pi. There's a lot of guides for that, and you don't need any additional help

If you play minecraft, you probably know how memory demanding this game can be. This is the same with minecraft servers as well, and if you're running craftbukkit with a good amount of plugins involved, you might as well just have sold your RAM sticks to Satan himself.

The problem is, a lot of people like me might not have enough RAM on our systems, but we still want to run one of those fancy community minecraft servers anyway. So what do we do to solve the impossible?

Well in my case, the machine I wanted to run a bukkit server on was a Digital Ocean VPS that I rented primarily to host my website. Unfortunately, my droplet featured only a 512MB memory module and my LAMP package took up a good percentage of that. So that left me with something close to 350MB of memory for anything else.
Having had experience at running heavy bukkit servers on my home desktop before, I knew that if I ever wanted to run a minecraft server off this system, I'd have to come up with a good solution.

If you've done a bit of research prior to reading this post, you'll know that Spigot is an optimized version of craftbukkit for this very purpose. So the first thing I did was simply drop the spigot jar file on my VPS and run this command :

java -Xms192M -Xmx512M -XX:MaxPermSize=128M -jar spigot.jar

Everything loaded up fine, but whenever I connected to it via my Minecraft client, the Java process got killed by the OS. I tweaked around with the Xms and Xmx flags in the command but no matter what, the server process never survived after a player connecting. All I could see was "Killed" before the process exited and I was sent back to the command line.


After lots of searching on Google and posting on forums, I got the same answer everywhere:

I simply did not have enough RAM on my machine. 

Almost ready to give up, I found this post on my VPS company's support forum.
All Digital Ocean droplets came along with SSD drives for hard storage. In that context, the answer made a lot of sense. Even if the java process did use some of my SSD for memory, the fact that they were Solid State Disks, and not regular Hard Disks should reduce the lag issue that arises from this solution by a huge factor.
Turns out, my VPS did not have swap enabled by default, so I followed the guide provided for my version of Ubuntu to set it up.

Once done, I launched the minecraft server, and voila! It's been running ever since, even with a couple of bukkit plugins attached.
So in summary. if you have less memory to run a minecraft server, the most likely solution is to use a swap file/drive along with your system.

Hopefully, this guide has helped you learn some concepts at least if not for directly helping you out with your issue. If you have the time, feel free to drop by my minecraft server. Point your clients to "enkrypt.in" and you should be set.

Friday, November 21, 2014

The new enkrypt.in is here

After more than a year of rigorous development, the new interface is finally out in the open.
Well I'll be honest, the reason it took me so long for this project was because I have a surprising talent for automatically procrastinating. My daily work cycle includes spending the day with the editor in the background, buried by every distraction the internet has to offer; and then pushing code after midnight at a rate that is not recommended for the healthy. I've lost count of how many sleepless nights this website now owes me, but I am indeed glad that it's finally fucking over.


Procrastination wasn't the only thing that held me back though. I did run into a dilemma halfway through the development process. My web host got taken down a couple of months ago (The host was not owned by me), and that's when I realized that I needed a permanent hosting solution instead of migrating from one free host(er) to another.
So now came the issue of retrieving backups from the expired host, painfully shelling out money to buy some new server space, and then configuring it right to host my website (If I ever somehow finished it). Of course, I did finally finish it, but I also bought a sweet VPS for myself from Digital Ocean along the way.

If you haven't noticed yet, my proudest part of enkrypt.in is the way I've made everything dynamic. Page reloads and statically loading content is for wimps. I hand coded most of what you're seeing with the use of barely any plugins. The site design is completely of my creation but I now wish that I'd used some already existing plugins to help me out and save all that work. There's a lot of PHP, a lot more of Javascript and some HTML from me that's holding this place together.
There are still possibly tons of bugs throughout the site even though I think I've smoothed out most issues, so if you're the kind of guy who likes to toy around with fragile, poorly protected webpages for vulnerabilities, then by all means go ahead. But even if you're not, please let me know if you discover a bug, glitch or error that's not supposed to be there so that I can fix it at once.

I again haven't written a blog post in more than a year because I'd promised myself not to, until I'd finished my site since my blog's being integrated into it. So now that that's done, I'll hopefully stick to my new rule: of keeping my content short. (some of my previous posts were way longer than they needed to be), and posting more often.

Well there should be a good amount of content here on this site for you to go through, and hopefully some will interest you. If you like what I've made and think this is neat, there should be some Like, Share and Plus One buttons on this page that I would really thank you for using.