Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.

# Thread: Think Any Of You Can Code This? Plz Try

1. ## Think Any Of You Can Code This? Plz Try

I am really bad at coding. but i have invented a Cyphyr.
I REALLY want this into a Encoding/Decoding program for me and my cousin.
I will explain the Cyphyr bellow. and if ANYONE is up to the task of making it a program..
(i understand what i am asking of you is alot.. well atleast i think it is. maybe it'll take you guys like 2 minutes... i dont know)
----------------------------------------------------------
input a date: 24/08/1988
the code is: 24081988

message: this is magical

--"x"s are spaces

thisxisxmagical

--then you loop the code over top of the letters in the encryption

2 4 0 8 1 9 8 8 2 4 0 8 1 9 8 8
t h i s x i s x m a g i c a l

--then you use this data to move forward in the alphabet

T: abcdefghijklmnopqrstuvwxyz
--move forward 2 letters from "T" , so "V"

H: abcdefghijklmnopqrstuvwxyz
--move forward 4 letters from "H" , so "L"

I: abcdefghijklmnopqrstuvwxyz
--move forward 0 letters from "I" , so "I"

ect.

--and eventually you have the encryption:

VLIAYRAFOEGQDJT

--then reverse all of these for the decryption:

VLIAYRAFOEGQDJT

2 4 0 8 1 9 8 8 2 4 0 8 1 9 8 8
V L I A Y R A F O E G Q D J T

--then you use this data to move backwards in the alphabet

V: abcdefghijklmnopqrstuvwxyz
--move backwards 2 letters from "V" , so "T"

ect.

---------------------------------------------------------

So if any coder is up to the task please make my Cyphyr into a Encrypting/Decrypting program
Ty!

At least make ANY attempt!

• That's about as strong a cipher as wet tissue paper. Most hackers could decode it in minutes.

Plus, if you do the encoding in JavaScript in the browser, anybody can simply look at the code and figure out almost instantly what you are doing.

But...

The code is trivial.

Code:
```var alphabet = "abcdefghijklmnopqrstuvwxyz";
var key = "24081988";

var result = "";
for ( var m = 0; m < message.length; ++m )
{
var ch = message.charAt(m).toLowerCase();
var chnum = alphabet.indexOf(ch);
if ( chnum < 0 )
{
// used a character not in the alphabet
// what do you want to do with it?
result += ch; // just put it in the result?
} else {
var koff = Number( key.charAt(m % key.length) );
result +=alphabet.charAt( ( chnum + koff ) % alphabet.length );
}
}
You should consider making your alphabet contain space, numbers, symbols, upper and lower case, etc. It would be (very mildly) more effective.

I'll let you work out the decrypting code. Just one small part of one line needs to be changed.

• Originally Posted by Old Pedant
That's about as strong a cipher as wet tissue paper. Most hackers could decode it in minutes.

Plus, if you do the encoding in JavaScript in the browser, anybody can simply look at the code and figure out almost instantly what you are doing.

But...

The code is trivial.

Code:
```var alphabet = "abcdefghijklmnopqrstuvwxyz";
var key = "24081988";

var result = "";
for ( var m = 0; m < message.length; ++m )
{
var ch = message.charAt(m).toLowerCase();
var chnum = alphabet.indexOf(ch);
if ( chnum < 0 )
{
// used a character not in the alphabet
// what do you want to do with it?
result += ch; // just put it in the result?
} else {
var koff = Number( key.charAt(m % key.length) );
result +=alphabet.charAt( ( chnum + koff ) % alphabet.length );
}
}
You should consider making your alphabet contain space, numbers, symbols, upper and lower case, etc. It would be (very mildly) more effective.

I'll let you work out the decrypting code. Just one small part of one line needs to be changed.
I was thinking of maybe this?:

1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik,9ol.0p;/

its like going diagonal from the num line of the keyboard to the bottom most character.

do you think that would make it any more secure?? btw, thanks for the quick reply!

• No. So long as the code is sitting there in JavaScript for anybody to see, it is not secure. Period.

If you want secure encryption, you need to do it on the server (e.g., in PHP/ASP/JSP code). And you need a heluva lot better algorithm than that one.

• hmm..... im not that advanced so i have no idea what that is supposed to mean. but don't servers cost money?

• Also im a mega newb and i was wondering if you could make the code into an .exe

i frankly have no idea how to test the code... ;P

I would really appreciate it

• \$5 a month. Or even less for some.

Shared server. Example: GoDaddy.com but there are many others.

• Originally Posted by MistaaKay
hmm..... im not that advanced so i have no idea what that is supposed to mean. but don't servers cost money?
Not necessarily!
The server is the computer where the document is stored, which can be the computer that you are sitting by right now.
Though you wil have to install the server-side languages on the computer in order to use them.
--------
One of the difference between server-side language and client-side languages is that the source of client-side coding is accessible for all to see, while you cannot access the source of server-side coding. Here you only see the result.

In other words:
With client-side coding you can see every step taken towards the final result, and thus you are able to reverse every step, to get back to the original unencrypted data. It is just a matter of time, will, and sense of logic

With server-side coding you will only see the result. Every step from the original code will be hidden to the viewer, thus they cannot know what steps has been taken, which mean that they can't reverse it.

• Originally Posted by Lerura
Not necessarily!
The server is the computer where the document is stored, which can be the computer that you are sitting by right now.
Though you wil have to install the server-side languages on the computer in order to use them.
--------
One of the difference between server-side language and client-side languages is that the source of client-side coding is accessible for all to see, while you cannot access the source of server-side coding. Here you only see the result.

In other words:
With client-side coding you can see every step taken towards the final result, and thus you are able to reverse every step, to get back to the original unencrypted data. It is just a matter of time, will, and sense of logic

With server-side coding you will only see the result. Every step from the original code will be hidden to the viewer, thus they cannot know what steps has been taken, which mean that they can't reverse it.
Originally Posted by Old Pedant
\$5 a month. Or even less for some.

Shared server. Example: GoDaddy.com but there are many others.

hey guys... im not looking for maximum security encrypting here. just as much as i need to have secret / private conversations :P

can you make the code into a .exe for me please? i have no idea how to do that and i cannot test the program to see how it is ;/ sorry for being Ultra Newb

• There is no .exe file to create.

Save a text file (Old Pedant's example in post #3) with an .html extension.
Note: Be sure to surround his example with <script type='text/javascript"> </script> tags.

Open that file on your computer with a browser 'open file' action.

• Originally Posted by jmrker
There is no .exe file to create.

Save a text file (Old Pedant's example in post #3) with an .html extension.
Note: Be sure to surround his example with <script type='text/javascript"> </script> tags.

Open that file on your computer with a browser 'open file' action.
It doesnt do anything :/

just a blank screen...

i surrounded it with the tags and i saved it as a .html

• *sigh*

Okay...here you go...
Code:
```<html>
<title>Uncle Billy's Magic Two Way Decoder Ring</title>
<body>
<h2>Don't forget to eat your cereal!</h2>
<br/><br/>
<form id="theForm">
Message: <input name="msg" size="60"/>
<br/>
Key: <input name="usekey" size="10" />
<br/>
Encoded: <input name="coded" size="60"/>
<br/>
<input type="button" name="encode" value="Encode"/>
<input type="button" name="decode" value="Decode"/>
</form>

<script type="text/javascript">

var alphabet =
"WX;#!Q,:S&TYZhR%\$U0<+k>n-V[i.j()l ?1]*=362mcdHACG_EsIJ4Kp^9@MNBOq5PeortLb7xa8{|Dgf}Fyuvwz~";

var form = document.getElementById("theForm");

function encodeDecode( sFrom, mult )
{
var key = form.usekey.value;
var result = "";
for ( var m = 0; m < sFrom.length; ++m )
{
var ch = sFrom.charAt(m);
var chnum = alphabet.indexOf(ch);
if ( chnum < 0 )
{
// used a character not in the alphabet
// what do you want to do with it?
result += ch; // just put it in the result?
} else {
var koff = Number( key.charAt(m % key.length) );
//          var koff = alphabet.indexOf( key.charAt(m % key.length) );
var c = ( chnum + alphabet.length + mult * koff ) % alphabet.length;
result += alphabet.charAt( c );
}
}
return result;
}

form.encode.onclick =
function()
{
form.coded.value = encodeDecode( form.msg.value, 1 );
};

form.decode.onclick =
function()
{
form.msg.value = encodeDecode( form.coded.value, -1 );
};
</script>
</body>
</html>```
If you replace the line in blue with the line in red (after removing the // from the front), then you can use any WORD or words as the key, instead of having to use a number. (As written, the key must be a number.)

• If it's not obvious:

To encode a message, type it into the first text box. Type your key (must be all digits unless you make the change I indicated) into the second text box. Press the Encode button.

To decode a message, type the coded message into the THIRD text box. Type your key (must be all digits unless you make the change I indicated) into the second text box. Press the Decode button.

• ## Users who have thanked Old Pedant for this post:

MistaaKay (07-26-2012)

• Originally Posted by old pedant
if it's not obvious:

To encode a message, type it into the first text box. Type your key (must be all digits unless you make the change i indicated) into the second text box. Press the encode button.

To decode a message, type the coded message into the third text box. Type your key (must be all digits unless you make the change i indicated) into the second text box. Press the decode button.
thank you you f*%king boss!

loveee youuuuuuuu (all homo!)

i "Thanked" you and +Rep'ed you!

•
Page 1 of 2 12 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•