Thanks to these people on reddit for the code. http://www.reddit.com/r/visualbasic/comments/26dgn0/creating_a_secure_string/ .