Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Very simple password encode and decode

I want a very simple password encryption that doesn’t need to be secure

I currently encode the password with

import base64
passwd = "test"
passwd = bytes(passwd, "UTF-8")
passwd = passwd.hex()
passwd = bytes(passwd, "UTF-8")
passwd = base64.b64encode(passwd)

if i set "test" as input the output is "b’NzQ2NTczNzQ=’"

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I’m having problems reversing this. So far i have tried the folloving

import base64
passwd = "b'NzQ2NTczNzQ='"
passwd = base64.b64decode(passwd)
passwd = str(passwd).replace("b","").replace("'","")
passwd = bytes(passwd, "UTF-8").hex()

But the output of that is "3734363537333734"

>Solution :

You just reverse each step.

import base64
passwd = b'NzQ2NTczNzQ='
passwd = base64.b64decode(passwd)
passwd = str(passwd, "UTF-8");
passwd = bytes.fromhex(passwd);
passwd = str(passwd, "UTF-8");

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading