Custom Cipher -- What do you think? 04-03-2017, 03:58 PM
#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.
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, under a certain key. If I were to input "hello" and encrypt it with the same key, .
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.
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 --> defghijklCode:
hello --> kiqrvIs 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?”
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)









