FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Challenge with Crypt/Uncrypt
Challenge with Crypt/Uncrypt
Débuté par Sam, 19 avr. 2021 18:57 - 2 réponses
Connectez-vous…
Sam
#1
Membre enregistré
2 messages
Posté le 19 avril 2021 - 18:57
Dear All,
I am struggling to crack an encryption nut.
I have the code below to save and retrieve an encrypted password. I expect the displayed result to be the original password entered but this is not the case.
Any advice will be appreciated.
======================================
gpwuser.Name=Crypt(gpwuser.Password,"vintage53")
HModify(gpwuser)
Info(gpwuser.Password, Uncrypt(gpwuser.Name,"vintage53"))
======================================
I expect the two displayed results to be gpwuser.Password, but it is not so.
Thanks.
Sam.
Signaler
0
0
Charly CANDO
#2
Membre enregistré
948 messages
Popularité : +30 (92 votes)
Posté le 20 avril 2021 - 00:13
Coucou Sam,
Two way to fix this issue.
1) Use crypteAnsi
gpwuser.Name=Crypt(gpwuser.Password,"vintage53", crypteAnsi)
HModify(gpwuser)
Info(gpwuser.Password, Uncrypt(gpwuser.Name,"vintage53", crypteAnsi))
2) Change the type of 'gpwuser.Name' & 'gpwuser.Password' to UNICODE.
---
#lapiraterienestjamaisfinie
Signaler
0
0
Argus
#3
Posté le 20 avril 2021 - 14:39
two things:
1. most of the time, encrypting a password is NOT best practice. You should instead HASH it, and there is no coming back from that, which would make your question moot.
2. If you are in a very rare case where encrypting/decrypting passwords is necessart (a password manager is on of those cases), then you should be aware that the RESULT of an encryption is a BINARY and should be stored as such (in a binary memo). As it can contain binary ZEROs, your decryption will not work in SOME cases (when there are zeros, which is the string ending flag).
So either store it as binary in a binary memo, or transform the result of the encryption in hexa or base64
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte