Skip to content
Advertisement

how to decrypt each hash string from a text file using openssl_decrypt and output each line

i have a text.txt file which contains a list of encrypted passwords, each line starts with the name then a seperating symbol and then the encrypted passoword. the list looks like-

JavaScript

now i want to decrypt password from each line using the key which is included in the code. to seperate the hash and name i use php explode() function and “-&&-” as the seperator which gives me this array as output

JavaScript

the output looks like-

JavaScript

Now the main question is how do i use openssl_decrypt() in combination with this to get each line decrypted.

Advertisement

Answer

So i researched a lot about this problem tried the solution provided by @Edoldin in my question. I searched the problem in PHP official documentation- Here and OPENSSl documentations here- Here

I got the solution by modifing and using this code-

JavaScript

This is the Final solution i am using. Thanks.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement