Results 1 to 3 of 3

Thread: Difference between Public and Private Key when using XOR cipher encryption

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    2

    Post Difference between Public and Private Key when using XOR cipher encryption

    Hi there,

    Not sure which forum subject is best suited. It’s encryption related, sorry if I chose the wrong one.

    I have created a tool in vb6 that encrypts bytes using the XOR operator. Now I am trying to expand on this by making key pairs “Public and Private Keys” (where the Private Key is different to the public key \ or that they are kept separate) and I have come to a dilemma understanding the theory, I hope someone can help, or point me in the right direction.

    I am trying to understand the locking mechanism that locks files that are encrypted using a public-key rendering the encrypted file not decrypt-able by the public key, but only the private key.

    The encryption process is using XOR encryption with 128-bit keys. In Xor cipher encryption, to my knowledge the Enc-Key and Dec Key are the same when switching bits are concerned.

    I understand the principles of Bob and Alice theory. But in computer code, what extra code goes into the encrypted file to stop the file being decrypted with the public key?

    Does, during the enc phase, the enc-programme insert a signature (i.e. MD5 Hash string pre-generated from the Private Key) that the dec-programme extracts from the file, the dec-programme then compares the signature with a private-key signature. If there is a match of signatures then the file can be decrypted, otherwise abort decryption.

    So if this is the case then the Signature or formula to make the signature or hash key needs to be attached to the Public-key in the first place to put into the encrypted file…..… thus how can the private key be secure?

    I’m been banging my head against the wall for 3 days and going in loops.

    Does any of this any sense?

    Encrypt:
    Public Key: 101010
    Plain Text: 010001
    Encrypted: 000100

    Decryot:
    Private Key: 101010 (bits same as public key)
    Cipher: 000100
    Decrypt: 010001

    So where’s the difference in Public key and Private Key?

    Thanks.

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Difference between Public and Private Key when using XOR cipher encryption

    Using an XOR scheme like the one you listed, a public/private key system doesn't seem to make much sense, because the private key never gets used. As you said if you encrypt with the public key, you can decrypt with it. The XOR method works well if you have a "1-time pad", a private key that only two people know--the one who encrypts the message and the one who decrypts it.

    RSA is probably the most influential encryption algorithm ever made and successfully uses a public/private key scheme. It uses a much more complex encryption scheme than XORing the public key with the message. Unfortunately the math involved is relatively complicated--starting from the worked example and reading the article backwards might be more useful than reading straight through. It also references a lot of number theory you might have to take as given, and assumes you know a fair amount about modular arithmetic.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    2

    Resolved Re: Difference between Public and Private Key when using XOR cipher encryption

    Hiya,

    Cool, thanks for the info. I hadn’t thought of RSA, the mathematics involved in RSA source code looks challenging, I’ll see if I can put the RSA method into vb code myself.

    Cheers,
    Adrian

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