I need to encrypt a password with SHA3-224. Is there any builtin function?

Hi,
I’ve need to pass some data to an in-house platform.
The authentication process requires to hash the password with SHA3-224 method.

However built-in function available are sha1 and sha256.

Do you have any idea how to do that easily ?
Any workaround with a third party platform ?

Any help would be greatly appreciated.
Thanks

That’s a great idea! I’m sure others would agree that this is a nice feature to have.

Currently SHA3 is not available via the encrypt module.

You can submit this suggestion to the Idea exchange, under Platform ideas and improvements.

Don’t forget to search for it first, just in case someone already suggested it, so that you don’t end up creating a duplicate.
Screenshot_2024-01-17_130153

samliewrequest private consultation

Join the unofficial Make Discord server to chat with us!

2 Likes

Thanks @samliew

Finally succeeded with a workaround through 0codekit

import hashlib

def encrypt(pwd):
    # Convertir la chaîne en bytes
    pwd_bytes = pwd.encode('utf-8')
    # Création de l'objet hash avec SHA3-224
    hash_object = hashlib.sha3_224(pwd_bytes)
    # Obtention du hash en hexadécimal en majuscule
    data = hash_object.hexdigest().upper()
    return data

# Vous devez définir la variable 'mavariable' avec une chaîne de caractères
mavariable = "{{2.pwd}}"
result = {
    "data": encrypt(mavariable)
}
4 Likes

Excellent, thanks for sharing your workaround with us!

2 Likes