Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Post 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..
    PLEASE DO!!
    (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!
    Last edited by MistaaKay; 07-24-2012 at 09:59 PM.

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,073
    Thanks
    38
    Thanked 498 Times in 492 Posts
    Read post #3 of sticky #4 ( MUST READ- How to post a JavaScript question! )

    At least make ANY attempt!

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,133
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    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 message = "your message";
    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 );
        }
    }
    alert( result );
    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.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #4
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    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 message = "your message";
    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 );
        }
    }
    alert( result );
    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!

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,133
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    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.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #6
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    hmm..... im not that advanced so i have no idea what that is supposed to mean. but don't servers cost money?
    Last edited by MistaaKay; 07-25-2012 at 01:39 AM.

  • #7
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

  • #8
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,133
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    $5 a month. Or even less for some.

    Shared server. Example: GoDaddy.com but there are many others.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #9
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    894
    Thanks
    0
    Thanked 117 Times in 116 Posts
    Quote Originally Posted by MistaaKay View Post
    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.

  • #10
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Lerura View Post
    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.
    Quote Originally Posted by Old Pedant View Post
    $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

  • #11
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,073
    Thanks
    38
    Thanked 498 Times in 492 Posts
    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.

  • #12
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jmrker View Post
    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

  • #13
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,133
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    *sigh*

    Okay...here you go...
    Code:
    <html>
    <head>
    <title>Uncle Billy's Magic Two Way Decoder Ring</title>
    </head>
    <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.)
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #14
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,133
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    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.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    MistaaKay (07-26-2012)

  • #15
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by old pedant View Post
    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!
    Last edited by MistaaKay; 07-26-2012 at 02:08 AM.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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