I made an encryption program that successfully encrypts data but my problem is this: How to create it decryption program? Looks like because I used a lot of bitwise operators in this program some 0s or 1s are lost so it looks like a hashing program instead of a encryption program.. I thought that I would save those lost bits in a string but how?
If you who created the encryption function don't know that, who will?
I thought that I would save those lost bits in a string
That doesn't sound practical. Different bits may be lost or added at different points in the algorithm, or even depending on the values of other bits. If you understand your algorithm sufficiently to save that information, you probably understand it enough to be able to remove the bit lossage.
Thanks a lot for your help . I actually dont fully understand my algorithm and that pisses me off (dont ask why and how i just added some random bitwise opperators)..
But again i read that & and | can cause data loss.
I wanna to know How to save those lost bits in a string
Well i wanna save them in plaintext.
Also i dont want to prevent this data loss cause it makes hard to decrypt without those lost bits.
This data loss is going to be something like a key.
Also i dont want to prevent this data loss cause it makes hard to decrypt without those lost bits.
Huh? The point of cryptography is to encapsulate an insecure channel to be able to treat it as a secure channel through which to transmit data. If you have a channel that's secure enough to transmit the lost bits then you have a channel that's secure enough to transmit the original plaintext.
This data loss is going to be something like a key.
If I use your algorithm to encrypt 1 gigabit of information, in all likelihood I'm going to get around 500 megabits of key. That's not all that easier to keep secure than the original message. I'm much better off generating a one-time pad and XORing it with the plaintext. That key is only twice as long, but the ciphertext is completely unbreakable, and the algorithm is several orders of magnitude simpler to implement.