Results 1 to 8 of 8

Thread: [RESOLVED] DES function?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Resolved [RESOLVED] DES function?

    I've looked around and can't seem to find a simple DES function I can incorporate into my code, a simple one where I can give the string and key (and perhaps salt, although not important to my code right now :-)) and it outputs the encrypted text.

    I found VBCrypto, but it's serious overkill with all sorts of other functions built into it and I'm not sure if I would be able to clean out the unimportant code from it to keep it short and sweet.

    Has anyone got a simple module or something I can use which lets me call the function and get the data back?

    Just to confirm, I want *DES* and not triple-DES, there's tons of triple-DES (3DES) and AES stuff out there, I need DES

    Edit: VBCrypto includes class modules that in theory work on their own, but I know nothing at all about using classes in programs, I usually use modules myself...perhaps that is where I need the help :-)
    Last edited by smUX; May 18th, 2009 at 06:24 PM.
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    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
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: [RESOLVED] DES function?

    Quote Originally Posted by si_the_geek View Post
    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 :-)
    Attached Files Attached Files
    Last edited by smUX; May 19th, 2009 at 05:13 AM.
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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)

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    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 :-)
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: [RESOLVED] DES function?

    At this rate I'll be better off trying to learn how DES works and write my own module :-P
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    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
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

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