CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2009
    Posts
    1

    Decryption computation help.

    I am writing a program and this is what was found wrong with it. This program is suppose to decrypt an encrypted message (char CodedMessage[16] = ":mmZ\\dxZmx]Zpgy). Any help to change this computation would be greatly appreciated.


    //**************************
    // This is the code to encrypt a message
    // You need to change this computation to decrypt an encrypted message
    if ((e + key) > 126)
    {
    d = 32 +((e + key) -127);
    }
    else
    {
    d = e + key;
    }
    //**************************

  2. #2
    Join Date
    May 2009
    Location
    New Zealand
    Posts
    4

    Exclamation Re: Decryption computation help.

    You do realise the function you have posted gives overlapping data, which means it cannot be resolved as some of the encrypted characters will have two decrypted answers.

  3. #3
    Join Date
    May 2009
    Location
    New Zealand
    Posts
    4

    Cool Re: Decryption computation help.

    Quote Originally Posted by gnarcorej View Post
    I am writing a program and this is what was found wrong with it. This program is suppose to decrypt an encrypted message (char CodedMessage[16] = ":mmZ\\dxZmx]Zpgy). Any help to change this computation would be greatly appreciated.


    //**************************
    // This is the code to encrypt a message
    // You need to change this computation to decrypt an encrypted message
    if ((e + key) > 126)
    {
    d = 32 +((e + key) -127);
    }
    else
    {
    d = e + key;
    }
    //**************************

    Decoded the message, Very Messy method to do it though.
    your key is 25 and message is = "!TTACK_AT_DAWN`"

    if(( d - key ) > 32 )
    {
    e = d - key;
    }
    else
    {
    e = (( d - 32 ) + 127 ) - key;
    };
    Last edited by sthlndboy; May 18th, 2009 at 07:18 PM. Reason: Correcting Typo's

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured