• 0

Latest/Greatest way to ecrypt with PHP


Question

10 answers to this question

Recommended Posts

  • 0

More details would help I guess haha. It is an Admin username and password stored in a database. The admin has to enter the username and password when logging into the control panel. I want to save that password as securely as possible. I'm completely new to this and there are many options online, and I need some guidance.

Why are you encrypting passwords? Does it need to be reversible?

If you are storing the users login details try salting and hashing your passwords instead - SHA1

i will look into this! Thank you!

  • 0

Use crypt().


if (CRYPT_BLOWFISH == 1) {
crypt($password, $salt);
}
[/CODE]

It's one way (as it should be), so you'll need to store the salt somewhere, preferably generating a random one for each user than saving it in the database with the user's record. Then when the user logs in with a username and password, you can lookup the user by username, then:

[CODE]
if ($stored_password === crypt($entered_password, $stored_salt))
{
user_login();
}

[/CODE]

Note that in the documentation for crypt() they show how to check for various encryption methods if blowfish isn't available.

  • Like 2
  • 0

Hey all,

What's the best/safest way right now to encrypt a password to store into a MySQL database?

Depends on what you are encrypting!

My strategy for saving PII (Personal Identifiable Information) or PAN (Private Account Number) would be much different than just a Username / Password combination where the user cannot be identified.

This topic is now closed to further replies.
  • Posts

    • Salesforce to acquire Fin, formerly Intercom, for over $3 billion by David Uzondu Image via DepositPhotos.com Salesforce today announced that it has reached an agreement with customer support software company Fin to buy the company for around $3.6 billion. Salesforce expects the transaction to close in the fourth quarter of its fiscal year 2027, and the acquisition will not change its financial guidance previously announced on May 27. Marc Benioff, CEO of Salesforce, in its press release, claimed that acquiring the startup gives Salesforce an immediate AI agent that resolves support tickets across email, WhatsApp, SMS, and Slack: You might know Fin by its former name, Intercom. If you have ever been on a website or inside a mobile app and noticed a little chat bubble widget floating in the bottom right corner of your screen, often featuring a friendly face and a message like, "Hi! How can we help you today?" you were almost certainly looking at Intercom. Intercom became Fin just last month, transforming itself into an "AI-first" platform that handles customer issues with little need for humans to intervene. The new name originates from the company's highly successful AI customer service agent, which it launched way back in 2023. This digital assistant supposedly resolves about 76% of customer service volume end-to-end on its own, so the business rebranded to match its primary software tool. Fin's new owners, Salesforce, went on an acquisition spree over the last few years, and some of them you might recognize, like its 2020 $27.7 Billion acquisition of Slack. The last few months saw the enterprise giant buy several startups, including m3ter, Momentum, Cimulate, and Contentful. Salesforce said that when the Fin deal pulls through, customers will "deploy AI agents across" various service operations, which will complement Agentforce, the platform that enables businesses to deploy customizable autonomous digital workers.
    • Microsoft now allows you to tweak Visual Studio to new extremes by Usama Jawad Visual Studio 2026 recently netted a powerful feature that finally allows developers to review Git Pull Requests (PRs) directly in the integrated development environment (IDE), without needing to switch to the browser. However, that's not all that Microsoft introduced in the latest version, as it also offered a useful way to customize the IDE to their heart's content. Although Visual Studio 2026 already provides lots of stock themes based on Fluent Design principles, Microsoft understands that people still want to customize them further according to their preferences. The IDE now offers a new configuration page for themes under Tools > Options > Environment > Visual Experience > Theme colors. This allows you to set hex color codes for accent colors, hover states, and more, and apply them without requiring a restart. The Redmond tech giant further says that: Microsoft is also offering granular color tokens that allow you to customize various UX elements like the tab header without impacting the rest of the shell chrome. Your themes are also stored in JSON format in %LOCALAPPDATA%\Microsoft\VisualStudio\18.0_xxxxxxxx\ColorThemes, which basically enables you to share it with others or override existing themes. This is a major improvement in terms of the user experience powering these customization capabilities. This is because extensions were required to replace the theme, and it was not very easy to make minor adjustments. This theme configuration UX solves this problem and is available in Visual Studio 2026 version 18.7, available here.
  • Recent Achievements

    • Week One Done
      Jeroen Wilms earned a badge
      Week One Done
    • Week One Done
      rolfus earned a badge
      Week One Done
    • One Month Later
      Leroy Jethro Gibbs earned a badge
      One Month Later
    • Conversation Starter
      flexorcist earned a badge
      Conversation Starter
    • One Month Later
      AndreaB earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      503
    2. 2
      +Edouard
      201
    3. 3
      PsYcHoKiLLa
      127
    4. 4
      Steven P.
      82
    5. 5
      ATLien_0
      76
  • Tell a friend

    Love Neowin? Tell a friend!