Login Register


Custom Cipher -- What do you think? filter_list
Author
Message
Custom Cipher -- What do you think? #1
(Disclaimer: Use the term "encrypt" loosely in this post. Sorry.)

A while ago (back in the ol' main JavaScript game, long before I got into hacking), I made a little cipher tool to send messages to a friend and receive them back without having anybody be able to read them. Basically just a mini-encryption (use the term loosely) to prevent mitm's, etc. I'd like to know whether this could be used on a higher level, and what people generally think of it. You can create a plain-text key, and then submit the key and JS gives it a number value based on it's first 5 ascii values and multiplied by some big number that I made up. Keep in mind, this is back in the (g)olden days when I wasn't very good and/or sensible with JavaScript.

Code:
function charChange(form) { var intinp = form.input.value var inparr = new Array(intinp.length) var arrplu = new Array(inparr.length) var newasc = new Array(arrplu.length) for (var i = 0; i < inparr.length; i++) { var lengthn = i var cca = intinp.charCodeAt(i) inparr[i] = cca var inppluss = ((inparr[i] + 2) + lengthn) + finalkey / 30000000 console.log(inppluss) var inpplu = Math.round(inppluss) console.log(inpplu); var arrdec = String.fromCharCode(inpplu) newasc[i] = arrdec var newascstr = newasc.join("") document.getElementById("output").value = newascstr } }

It changes the ascii values and adds some to the value to prevent against the counting of characters, then converts them back to text. For example,
Code:
aaaaaaaaa --> defghijkl
under a certain key. If I were to input "hello" and encrypt it with the same key,
Code:
hello --> kiqrv
.

Is there any flaw you can find in this? Also, tell me if you don't understand some of the code or would like me to explain it in further detail.

“Why should I fear death? If I am, death is not. If death is, I am not. Why should I fear that which cannot exist when I do?”

[+] 1 user Likes Moros's post
Reply

RE: Custom Cipher -- What do you think? #2
your code looks quite neat, however you may want to consider adding comments so other users can understand
mybb sucks ass

Reply

RE: Custom Cipher -- What do you think? #3
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Hello = 5 characters in length.
H = 1 + 2 = 3 = K
E = 2 + 2 = 4 = I
L = 3 + 2 = 5 = Q
L = 4 + 2 = 6 = R
O = 5 + 2 = 7 = V

The flaw isn't in the programming... It is your method in general.
How many patterns are in my table above ?

The length always starts from 1 and for each letter it is +1.
You always add two to it.
You always end up with a number that starts with 3 and + 1.

So for any text you send with this. I start by moving the first letter 3 to the left.
The second 4 to the left
The third 5 to the left
and so on.

There you have your flaw and why this would never be used in anything on a "higher" level.

P.S
This is just a little bit improved Caesar Cipher...
(This post was last modified: 04-11-2017, 12:02 AM by Loki123.)

Reply

RE: Custom Cipher -- What do you think? #4
Welcome to boredom 101.


(11-02-2018, 02:51 AM)Skullmeat Wrote: Ok, there no real practical reason for doing this, but that's never stopped me.

Reply

RE: Custom Cipher -- What do you think? #5
(04-11-2017, 12:01 AM)Loki123 Wrote: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Hello = 5 characters in length.
H = 1 + 2 = 3 =  K
E = 2 + 2 = 4 =  I
L = 3 + 2 = 5 = Q
L = 4 + 2 = 6 = R
O = 5 + 2 = 7 = V

The flaw isn't in the programming... It is your method in general.
How many patterns are in my table above ?

The length always starts from 1 and for each letter it is +1.
You always add two to it.
You always end up with a number that starts with 3 and + 1.

So for any text you send with this. I start by moving the first letter 3 to the left.
The second 4 to the left
The third 5 to the left
and so on.

There you have your flaw and why this would never be used in anything on a "higher" level.

P.S
This is just a little bit improved Caesar Cipher...

Is just recursive.

Reply







Users browsing this thread: