GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV 2024
→
SHA256 of Windev is different to MySQL's
SHA256 of Windev is different to MySQL's
Iniciado por Juan, jan., 09 2019 4:52 PM - 3 respostas
Conecte-se…
Juan
#1
Publicado em janeiro, 09 2019 - 4:52 PM
Hello,
I am trying to hash the passwords using:
s
Password
is string
=
"MiContraseña"
s
Clave
is string
=
HashString
(
HA_SHA_256
,
s
Password
)
tmp
is string
FOR i
=
1
_TO_
Length
(
s
Clave
)
tmp
+
=
Right
(
NumToString
(
Asc
(
s
Clave
[
[i]
]
)
,
"08x"
)
,
2
)
FIN
ToClipboard
(
tmp
)
// b536931076054627e24dcebf50140c8374bf80b079fa017e91c72f48e8109eff
If I try
SELECT SHA2
(
'MiContraseña'
,
256
)
it will return '1ef1870f76d31f4b5e877996faf904fd5214135c9967100ff3eda9f568b4d751', which is obviously different from the output made by Windev 22.
Am I missing something, doing something wrong...?
Thank you.
Denunciar
0
0
Tim
#2
Membro registado
34 mensagems
Popularité : +3 (3 votes)
Publicado em janeiro, 11 2019 - 11:03 AM
Hi,
I'm not sure, but could it be that windev uses SHA1 vs SHA2?
Denunciar
0
0
Juan
#3
Publicado em janeiro, 11 2019 - 12:52 PM
Hello,
I tried making everything an ANSI String, and it worked.
Apparently the problem here is when you set the strings to UNICODE...
I have still that problem, some passwords will for sure contain special characters, and for some reason, when hashing the same ANSI string in UNICODE it will give a different output... I need to find a fix / workaround for that.
Denunciar
0
0
Rubén Sánchez Peña
#4
Membro registado
794 mensagems
Popularité : +40 (42 votes)
Publicado em janeiro, 11 2019 - 6:21 PM
Hi. Well, knowing that, you can convert unicode text into ANSI and vice versa. On the other hand HashString returns a buffer and not a string, since the result can contain non-printable characters.
Grettings
Rubén
Denunciar
0
0
→ Voltar para WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto