+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 15

Thread: Encryption using Random!?

  1. #1
    TcM
    TcM is offline
    Code Warrior TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM's Avatar
    Join Date
    Aug 2006
    Posts
    11,461
    Blog Entries
    6

    Encryption using Random!?

    Ok so last night I was thinking... if in encryption we use random integers.. won't it be safer?

    I'm just going to show a simple thing.. just so people can understand..so:

    Let's encrypt:

    A -> (ASCII*66)+random number

    I know what you are thinking.. is it's random.. it's useless, not an encryption.. NO keep on reading....

    So let's transform that into numbers

    (65*66)+125=4415

    Now what if we store that random number, 125, into the 4415 it's self for example inserting in the 1st,3rd and last digits, like this:
    1454152

    The bold numbers will be the stored random number I know it's 1,5,2 and then we swap the 2nd with the 3rd to bring it back to 125

    And then we just reverse the algorithm

    4415-125 = 4290/66 = 65->A


    Of course we can make it more secure by for example adding a fixed number to the random number and store it... there are many.. many methods..

    But what I mean is that in this way every encrypted string will be unique and it will have endless possibilities because for example A can be 4415 or maybe it can be 4790 (if the random number is 500) and of course we just insert the random number. so the same string.. will be different each time.

    What do you think? Is this practical? Are there any algorithms that already use this? Is this safer?

    Thanks for your comments.

  2. #2
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,640
    Blog Entries
    57
    At that point, you put the key directly into the encrypted message, making it relatively easy to decrypt. You are better off using random numbers to "bulk" the message with non-sense data that can be scrubbed out.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  3. #3
    TcM
    TcM is offline
    Code Warrior TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM's Avatar
    Join Date
    Aug 2006
    Posts
    11,461
    Blog Entries
    6
    What do you mean?

  4. #4
    Co-Administrator John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John's Avatar
    Join Date
    Jul 2006
    Age
    21
    Posts
    5,882
    Blog Entries
    25
    Your method seems similar to be getting at Public Key Encryption, but a poor implementation.

  5. #5
    TcM
    TcM is offline
    Code Warrior TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM's Avatar
    Join Date
    Aug 2006
    Posts
    11,461
    Blog Entries
    6
    Hmm what is a Public Key Encryption exactly? And As I said.. this was just a simple example.. of course it can be much improved.

  6. #6
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,640
    Blog Entries
    57
    If your Random Number is 125, and your cipher text (by other means) is 'abcdef' make new cipher text '1ab2cd5ef' with the 125 as garbage data.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  7. #7
    TcM
    TcM is offline
    Code Warrior TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM's Avatar
    Join Date
    Aug 2006
    Posts
    11,461
    Blog Entries
    6
    So you encrypt and then just insert nonsense numbers and stuff.. right? but that nonsense does not a make a part of the algorithm as in my example.

  8. #8
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,640
    Blog Entries
    57
    Right. Unfortunately, I have yet to see a method of including random data in the encryption algorithm without exposing that data, reducing the value of having random data in the first place.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  9. #9
    TcM
    TcM is offline
    Code Warrior TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM is a name known to all TcM's Avatar
    Join Date
    Aug 2006
    Posts
    11,461
    Blog Entries
    6
    Quote Originally Posted by WingedPanther View Post
    without exposing that data
    What do you mean?

  10. #10
    Co-Administrator John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John's Avatar
    Join Date
    Jul 2006
    Age
    21
    Posts
    5,882
    Blog Entries
    25
    Quote Originally Posted by TheComputerMaster View Post
    Hmm what is a Public Key Encryption exactly?
    With public key encryption there are two "keys." A public key and a private key. The public key that is know to everyone, and is usually a large *prime* number which is used to encrypt the data.

    Then there is a private key that is mathematically related to the public key, but is cannot be practically derived from the public key which is used to decrypted the message.

    To create a poor analogy, in your example, the random number may be the public key, and 66 may be the private key.

+ Reply to Thread
Page 1 of 2
1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. PHP Code: Simple Encryption Algorithm
    By Void in forum PHP Tutorials
    Replies: 25
    Last Post: 09-01-2009, 08:20 PM
  2. Encryption – The Basics
    By TcM in forum Security Tutorials
    Replies: 15
    Last Post: 03-08-2009, 05:08 AM
  3. Return random numbers without duplicates
    By Paradine in forum PHP Tutorials
    Replies: 0
    Last Post: 08-26-2007, 02:07 PM
  4. Software to implement encryption
    By trust in forum General Programming
    Replies: 2
    Last Post: 02-21-2007, 05:18 PM
  5. Code:PHP Random Functions
    By John in forum PHP Tutorials
    Replies: 2
    Last Post: 12-03-2006, 10:04 AM

Bookmarks

Posting Permissions

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