Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Unix crypt() under windows.

Unix crypt() under windows.

Scheduled Pinned Locked Moved C / C++ / MFC
learningcsharpc++visual-studiohelp
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Franz Granlund 0
    wrote on last edited by
    #1

    Hello gurus. I'm currently programming am application for windows 2000 (in Visual Studio C++ 6.0). It's a program that creates LDIF files that will be used to update a LDAP entries. (openLDAP) I've run into one problem tough. Is there a function/library in VSC++ that is similar to the unix crypt()? (using md5 or the ldap {crypt}) Yes, I'm a beginner, but I'm learning. :laugh:

    M C R 3 Replies Last reply
    0
    • F Franz Granlund 0

      Hello gurus. I'm currently programming am application for windows 2000 (in Visual Studio C++ 6.0). It's a program that creates LDIF files that will be used to update a LDAP entries. (openLDAP) I've run into one problem tough. Is there a function/library in VSC++ that is similar to the unix crypt()? (using md5 or the ldap {crypt}) Yes, I'm a beginner, but I'm learning. :laugh:

      M Offline
      M Offline
      Martin Ziacek
      wrote on last edited by
      #2

      Franz Granlund wrote: Hello gurus. Hi there. :) Franz Granlund wrote: Is there a function/library in VSC++ that is similar to the unix crypt()? Try to use CryptoAPI. Maybe you will find it too complex, but it should fulfil your requirements.

      F 1 Reply Last reply
      0
      • M Martin Ziacek

        Franz Granlund wrote: Hello gurus. Hi there. :) Franz Granlund wrote: Is there a function/library in VSC++ that is similar to the unix crypt()? Try to use CryptoAPI. Maybe you will find it too complex, but it should fulfil your requirements.

        F Offline
        F Offline
        Franz Granlund 0
        wrote on last edited by
        #3

        Thank you for your answer, but that is way to complex for me.. =) Do you know of any other library? Or could you help me get started? It's such a small application, that I don't wan't to spend to much time figuring the crypto-world out. :) (Yes, I wan't to learn someday, but not today. :)) :laugh:

        M 1 Reply Last reply
        0
        • F Franz Granlund 0

          Thank you for your answer, but that is way to complex for me.. =) Do you know of any other library? Or could you help me get started? It's such a small application, that I don't wan't to spend to much time figuring the crypto-world out. :) (Yes, I wan't to learn someday, but not today. :)) :laugh:

          M Offline
          M Offline
          Martin Ziacek
          wrote on last edited by
          #4

          I am not sure if using some library would be easier. Try to write short pseudocode, what you are doing in your UNIX code and I will reply with MS Crypto API version.

          F 1 Reply Last reply
          0
          • M Martin Ziacek

            I am not sure if using some library would be easier. Try to write short pseudocode, what you are doing in your UNIX code and I will reply with MS Crypto API version.

            F Offline
            F Offline
            Franz Granlund 0
            wrote on last edited by
            #5

            First, thank you very much for trying to help me out! Well, I wan't a crypt() functionality of a linux system that uses PAM and MD5 password enabled. (The linux dist is Redhat 7.3) A short code written and compiled under linux: #include int main() { char p[100]; // Allocate this dynamically later.. char s[100]; char *e; strcpy(p, "fan"); strcpy(s, "xe"); e = crypt(p, s); printf("Password: %s\nEncrypted: %s\n",p, e); return 0; } The output: $ ./m Password: fan Encrypted: xeY7nbSvmz7jU Hope you get some information from this code.. Again, thank you for trying to help.

            M 1 Reply Last reply
            0
            • F Franz Granlund 0

              First, thank you very much for trying to help me out! Well, I wan't a crypt() functionality of a linux system that uses PAM and MD5 password enabled. (The linux dist is Redhat 7.3) A short code written and compiled under linux: #include int main() { char p[100]; // Allocate this dynamically later.. char s[100]; char *e; strcpy(p, "fan"); strcpy(s, "xe"); e = crypt(p, s); printf("Password: %s\nEncrypted: %s\n",p, e); return 0; } The output: $ ./m Password: fan Encrypted: xeY7nbSvmz7jU Hope you get some information from this code.. Again, thank you for trying to help.

              M Offline
              M Offline
              Martin Ziacek
              wrote on last edited by
              #6

              Well, when it is Linux, you have to have sources for it, including crypt() function, have you tried to port to Win32? And, do you expect to get the same result (xeY7nbSvmz7jU), or you just do not care and encrypted password is enough for you (I mean, you do not require interoperability then between your new code on Windows and old code on Linux)?

              1 Reply Last reply
              0
              • F Franz Granlund 0

                Hello gurus. I'm currently programming am application for windows 2000 (in Visual Studio C++ 6.0). It's a program that creates LDIF files that will be used to update a LDAP entries. (openLDAP) I've run into one problem tough. Is there a function/library in VSC++ that is similar to the unix crypt()? (using md5 or the ldap {crypt}) Yes, I'm a beginner, but I'm learning. :laugh:

                C Offline
                C Offline
                Chris Losinger
                wrote on last edited by
                #7

                try crypto++. i think there is a tutorial somewhere on this site for it. -c


                To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
                   /. #3848917

                Image Processing - easy, like Sunday morning.

                1 Reply Last reply
                0
                • F Franz Granlund 0

                  Hello gurus. I'm currently programming am application for windows 2000 (in Visual Studio C++ 6.0). It's a program that creates LDIF files that will be used to update a LDAP entries. (openLDAP) I've run into one problem tough. Is there a function/library in VSC++ that is similar to the unix crypt()? (using md5 or the ldap {crypt}) Yes, I'm a beginner, but I'm learning. :laugh:

                  R Offline
                  R Offline
                  Ravi Bhavnani
                  wrote on last edited by
                  #8

                  Franz, See this article. /ravi Let's put "civil" back into "civilization" http://www.ravib.com ravib@ravib.com

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups