FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 25
→
WX - CryptStandart e UncryptStandart
WX - CryptStandart e UncryptStandart
Débuté par BOLLER, 16 mar. 2018 14:16 - 1 réponse
Connectez-vous…
BOLLER
#1
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 16 mars 2018 - 14:16
C
ryptStandart
e UncryptStandart
//Exemplo para Criptografar
s
Message
is
Buffer
=
"Message to encrypt"
buf
Key
is
Buffer
=
HashString
(
HA_CKSUM_64
,
"password"
)
buf
Encrypt
is
Buffer
=
CryptStandard
(
s
Message
,
buf
Key
,
cryptDES
)
Info
(
buf
Encrypt
)
// Exemplo para Decriptografar
buf
Key
is
Buffer
=
HashString
(
HA_CKSUM_64
,
"password"
)
s
Result
is
Buffer
=
UncryptStandard
(
buf
Encrypt
,
buf
Key
,
cryptDES
)
Info
(
s
Result
)
//E no Windev Mobile
//Criptografia
B_senha
is
Buffer
=
HashString
(
HA_HMAC_MD5_128
,
"bob-esponja"
)
B_resultado_Criptografado
is
Buffer
=
CryptStandard
(
buf
_conteudo_sig
,
B_senha
,
cryptAES128
)
Info
(
B_resultado_Criptografado
)
//Descriptografia
B_senha
is
Buffer
=
HashString
(
HA_HMAC_MD5_128
,
"bob-esponja"
)
B_resultado_Descriptografado
is
Buffer
=
UncryptStandard
(
buf
_conteudo_sig
,
B_senha
,
cryptAES128
)
Info
(
B_resultado_Descriptografado
)
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Signaler
0
0
ARV
#2
Membre enregistré
498 messages
Popularité : +8 (8 votes)
Posté le 22 mars 2018 - 21:08
Hi
I use this function but it doesn't work pefectly between Android and PC for some reason.
Have you had that issue too?
I'm using windev mobile 20 and Windev 20 my text it's an Unicode String for both sides but it only uncrypt the first letter the rest is lost
heres my code:
//Encrypt in Android
pass
is UNICODE string
=
"Password"
buf
KEY
is
Buffer
=
HashString
(
HA_MD5_128
,
pass
)
s
Messa
is UNICODE string
=
E
DT_Text
buf
Encrypt
is
Buffer
=
CryptStandard
(
s
Messa
,
buf
KEY
,
cryptAES128
)
TableDB.Pa
=
buf
Encrypt
HAdd
(
TableDB
)
Info
(
"Done"
)
//Uncrypt on PC
HReadFirst
(
TableDB
,
ID
)
pass
is UNICODE string
=
"Password"
bufkey
is
Buffer
=
HashString
(
HA_MD5_128
,
pass
)
buf
SResult2
is
Buffer
=
UncryptStandard
(
TablaErrores.Pa
,
BufKey
,
cryptAES128
)
E
DT_Uncrypt
=
buf
SResult2
IF
buf
SResult2
=
""
THEN
Info
(
ErrorInfo
(
errFullDetails
)
)
END
Signaler
0
0
→ Revenir à WINDEV 25
WINDEV 25
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