Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

490
Views
How to decrypt an AES password in bash scripting?

I need to use a password to login to MySQL DB. But the password is stored in AES encryption algorithm.

The login will be:

AES_PASSWORD=2hhbdhbdhbdbh (the encrypted password in AES)
mysql -uroot -p$(AES_PASSWORD)

How do I decrypt this in shell and use it? I searched in other similar queries, and couldn't find anything related to AES.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You need to know more than just the password's AES string. You need to know which AES it was encrypted with, for example, and the key or password used to encrypt it.

But lets say you you're using aes256 and know the password is "secret". You can do this:

DECODED=`echo $AES_PASSWORD | openssl enc -d -a -aes256 -pass pass:secret`

And then call mysql with $DECODED as the password argument instead.

This may or may not be the best way to invoke mysql, however, as the password appears on the command line in plain text when someone looks at the process list with 'ps'.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!