Text Encrypter Update

After a year I've decided to update my text encrypter! Yep, it's been a year already, time flies.

What's new?

I've rewritten the encryption bit to be much more secure! The key is now 'salted' and hashed before being used to encrypt the text. A random initial vector is also created for the base of the encryption. The random salt and vector are placed in the output along with the encrypted text. In the future the salt could be placed along with the program but it would mean that it could only be decrypted by one machine. (installation of the program)

On a side note, the length of the key is 128 bits as you would need to download an update to remove the limitation on the key size in Java. (And be able to encrypt using 192 or 256 bits keys.) I've finally fixed a few small bugs concerning saving new files and accessing other drives. No other major changes in the GUI or the behaviour of the software.

Your old files will not be compatible with the new version! You will need to decrypt them with the 0.1 and re-encrypt them with the new 0.2 version.


Here is the new zip file: TextEncrypter.0.2.zip

A new Theme for 2014

Managed to finish this theme at last. It was staying there in the corner of my hard drive unfinished for months. The functionalities of the website doesn't change much, you can now share an article and there is a new button to scroll to the top of the page. (Nothing revolutionary) I hope you will like this new, clearer and smoother design! Including enlarged font, images and buttons.

Playing with canvas

I had a lot of fun the last few days while playing with the canvas element and now is the time to present the script I came up with.

Waves !

To test a few of the functionalities provided with the canvas I've decided to create a background generator. Currently, it generates multiple waves and you can set a few things like the number of oscillations or the shadow effect. Before going in details, I invite you to go a test it right away: The Wallpaper Generator
As you can see, this generator is limited in generating waves. In the future I may implement more generators as listed in the menu.

{ how }

I'll be mostly explaining and showing the Javascript code for this WebApp, I'm assuming you already know some HTML and the main thing you will need is a canvas element:
You may also want to set a default size and an id to it:

Resizing the Canvas

Sadly the styling of the element won't be enough to resize the canvas. In the app I'm not really resizing the element, I'm just recreating a new canvas with the desired dimensions. This requires the canvas to be contained in a parent we can refer to in our script, I'll be using #canvas-cont as the parent id.
function generate(){
	// getting the size from the inputs
	var sizex = parseInt($("#sizex").val(),10);
	var sizey = parseInt($("#sizey").val(),10);
	// replacing the canvas with a new one
	// redefining the main variables
	canvas = document.getElementById("canvas");
	ctx = window.canvas.getContext("2d");
	height = sizey;
	width = sizex;


To get interesting outputs I've decided to be able to randomize some inputs. As you can see you can manage the randomness of certain inputs by setting an interval. Here's two Javascript functions I've made to generate random umbers (and also an unused function to set the drawing to a random colour):
function rdm(min, max){
	return ((Math.random()*(max-min))+min);

function rdmint(min, max){
	return Math.floor((Math.random()*(max+1-min))+min);

function rdmColor(){
	ctx.fillStyle = "rgb("+rdmint(0,255)+","+rdmint(0,255)+","+rdmint(0,255)+")";

The Waves

I've created a general function to draw a wave:
function wave(ys,nb,ht){
	for(var x=0;x<=width;x++){
		var y=Math.sin(x*nb*Math.PI*2/width)*ht+ys;
The function takes 3 arguments. ys is where the wave should start on the y axis, nb is the number of waves you will have and ht is the height of the waves.
After drawing the wave, we finish the shape which will fill the bottom part of the canvas with the same colour.

On the Side

In order to create this WebApp I've used Bootsrap and a few plugins with jQuery. I'm using Slider for Boostrap and Colorpicker for Bootstrap allowing user-friendly inputs.

Bazinga Bot

Bazinga Bot (@bazingbot) is a bot I've developed last month, it should be online soon.

What is it?

Bazinga bot is a bot tweeting automatically to users saying 'Bazinga' on twitter. It will find the new post containing this word and reply with a catchphrase. It also replies, if you tweet him, with quotes from Sheldon (from the Big Bang Theory if you haven't guessed). Quotes will be added when new episodes comes out.

Under the hood

This bot was codded using Python and Twython, a library to use the twitter api with Python. In the fututre, it will run every few minutes on a Raspberry Pi or on this website. (The truth is, I wanted to find something interesting to do with my raspberry Pi.)
The bot will also search for 'opt out' words when users tweet to him, it will then add these users in an 'opt out' user list and will not annoy them again. Some of these words are 'Stop' or 'Shut'. The user can then 'opt in' again with tweets containing 'come back' for example.
This bot is meant to be fun, but some people might find it annoying, that's why I've added the opt-out feature.