|
-
Aug 4th, 2008, 01:12 PM
#1
Thread Starter
New Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|