Re: [RESOLVED] DES function?
As is often the case with this place, much trial and error and messing about on my part yields better results than actually waiting around for assistance :-P
Re: [RESOLVED] DES function?
A tip for the future - don't edit your posts unless it is just a couple of minutes after you first posted, and you are just making a minor clarification.
If it is any longer (like in this case) and/or the subject changes (like in this case), you should reply instead - that way people will know there is new information since they read it.
I read your initial post (as I suspect many others did in the 70 minutes), but could not help with the issue you had at the time - however I (and many others) could have helped with the new issue you added later, if only we had known it existed.
1 Attachment(s)
Re: [RESOLVED] DES function?
Quote:
Originally Posted by
si_the_geek
A tip for the future - don't edit your posts unless it is just a couple of minutes after you first posted, and you are just making a minor clarification.
If it is any longer (like in this case) and/or the subject changes (like in this case), you should reply instead - that way people will know there is new information since they read it.
I read your initial post (as I suspect many others did in the 70 minutes), but could not help with the issue you had at the time - however I (and many others) could have helped with the new issue you added later, if only we had known it existed.
Very true, but I felt at the time that it would have been considered bumping :-)
Technically I still have a problem, but I think this one I have to speak with someone knowledgeable in DES to sort this out...I'm inputting an 8-byte string and getting a 24-byte encrypted string back...I thought DES was supposed to encrypt the string without making it larger?
In a way, a simple DES function (or DLL but I would prefer something I can build into the code) would still be handy and I'd replace the one I am using from VBCrypt with the new one :-)
Edit: I've upped the DES class that came with VBCrypt. If possible, could someone help me find out how to properly encrypt with it so that the output matches the length of the input (8 bytes should become 8 bytes, any block lower than 8 bytes is padded) and give me the information needed to use it either as the class or a module version :-)
Re: [RESOLVED] DES function?
It's not a bump if you are adding more info, as it shows you are making some sort of progress on your own (whereas a bump is basically trying to get us to do it for you).
In terms of the extra size, I'm not too surprised by that - I would expect some overhead to store the key etc, and I suspect that it will remain at a fairly constant level (so for larger strings the effect is much smaller)
Re: [RESOLVED] DES function?
The key shouldn't be stored as part of the encryption though, should it? I thought the key was supposed to be used to decrypt the data?
I found this link on google and its DES encryption doesn't use any overheads, it turns an 8 byte string into an 8 byte string with the key kept separate and needing to be input when decrypting.
I assume you see my problem now...the length of the inputted string (when zero-padded to the nearest 8 bytes) should be the same as the length of the outputted string, and I am inputting an 8 byte string so it should be outputting an 8 byte string in return but it isn't. I don't know enough about DES or this class to find out why, but it's definitely in the encodebyte section of the class as I checked length at each stage of encodestring and it was when it sent it to encodebyte that the length jumped to 24 :-)
Re: [RESOLVED] DES function?
At this rate I'll be better off trying to learn how DES works and write my own module :-P
Re: [RESOLVED] DES function?
Talking of writing my own DES module, I probably will do and will post it here for people to comment on any speed gains I might be able to do to it...I've had a look around and found http://www.tropsoft.com/strongenc/des.htm which gives a simple enough explanation of how DES encryption works :-)
At the worst, I write a working function and people can modify it to improve its speed and it becomes part of the codebank as a collaborative effort :-P