Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6858947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:13:23+00:00 2026-05-27T02:13:23+00:00

I was wondering if there is a python cognate to PHP’s crypt() function that

  • 0

I was wondering if there is a python cognate to PHP’s crypt() function that performs in a similar way, generating a random salt and embedding it within the saved string.

I have a table of hashed passwords that were created using the $5$ string key to setup a SHA256 based salted cryptogram. These hashes had some additional recorded entropy attached to both ends at a fixed interval, but splitting these characters off the string and getting the core hash is trivial and not a problem at all.

I’ve looked at the python documentation and can’t find any methods in hashlib that seem to utilize the same syntax from php’s crypt(). Is the approach utilized in PHP (the input format split with dollar signs between salt, algo and rounds) unique to the language?

Thanks.

EDIT:

It looks as though the revised version of python’s own native crypt function is going to utilize procedures similar to that of PHP. From the 3.3 pre-release documentation:

http://docs.python.org/dev/library/crypt.html

EDIT:

Finally found Passlib, a library that provides this functionality in pure python.

http://packages.python.org/passlib/index.html

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:13:24+00:00Added an answer on May 27, 2026 at 2:13 am

    It certainly looks very similar to FreeBSD’s crypt (see “modular crypt” in the manpage). I don’t really recall if it’s the same way in Linux or other but this seems to indicate it’s not unique.

    There’s no direct equivalent in Python as far as I know, but it shouldn’t be too hard to roll your own since the encryption algorithms themselves should be supported in hashlib.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Python 2.x and I'm wondering if there's a way to tell if
I'm wondering if there's a reason that there's no first(iterable) in the Python built-in
I was wondering if in python there was a simple way to run code
I was wondering if there's a way in Python(2.6) to get only the name
I was wondering if there is any way to export python functions to dll.
I was wondering if there was a way that you could get init code
I was wondering if there's a way to plot a data cube in Python.
As the title suggest, I was wondering if there is a Python module that
I'm wondering if there exists a python module that would allow me to do
I am wondering if there is a standard library function in Python which will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.