PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
WX - CryptStandart e UncryptStandart
WX - CryptStandart e UncryptStandart
Started by BOLLER, Mar., 16 2018 2:16 PM - 1 reply
Connect yourself…
BOLLER
#1
Registered member
3,651 messages
Popularité : +175 (223 votes)
Posted on March, 16 2018 - 2:16 PM
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/
Report
0
0
ARV
#2
Registered member
498 messages
Popularité : +8 (8 votes)
Posted on March, 22 2018 - 9:08 PM
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
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text