PWD v1

As it had been a while since I last coded anything, I wanted to start over with my old encryption program idea. Enter PWD.

In version 1, I wrote a very simple function to take a user input string, and just put it in a variable and print to console. Very straightforward, very easy. In c# that’s Console.Write(), Console.ReadLine() into a string object, then Console.WriteLine().

Next, I wanted to add a very simple “hash” method to change the input. I chose to convert the string to binary using Encoding.UTF8.GetBytes() into a byte array, then flipped all the bits with a loop through the array. Bitconvert that back to a string for a hexadecimal string representing the flipped bits of the original input.

Step 3 (and the final step for the evening) was to add in a salt. I chose to set this as a globally-available string that gets cut into the input string to pad the string out before it goes through the bit-flipping method.

input: “PWD v1 is functional”
output: “AF92A890BB8DDF8B8990CE91DF8C96DF8CDFDFDF99DF8ADF91DF9CDF8BDF96DF90DF91DF9EDF93DF”

I think my next step will be to create something to limit the number of characters in the output, and I’d like to expand the output to use a-z, A-Z, and 0-9. Once I’ve figured those steps out, I will expand on the hashing steps. Once I get the hashing to a place I’m happy with, I will look into doing encryption instead of 1-way hashing (which would mean dropping the character limit on the output)

By:

Posted in:


Leave a comment