FOROS PROFESIONALES
WINDEV
,
WEBDEV
y
WINDEV Mobile
Inicio
|
Mensajes recientes
|
Conéctese...
|
Desconectar
|
Español
Inicio
→
WINDEV 2024
→
Encryption
Encryption
Iniciado por Piet van Zanten, 16,dic. 2008 15:39 - 3 respuestas
Conéctese…
Piet van Zanten
#1
Publicado el 16,diciembre 2008 - 15:39
Hi All,
I am trying to find a compatible way to encrypt and decrypt strings (passwords) between Windev and PHP. The security is a minor issue, so simplicity prevails.
I found a nice and simple php function to crypt and decrypt that uses base_64encode:
[code]
function encode5t($str)
{
for($i=0; $i
Informar
0
0
Alexandre Leclerc
#2
Publicado el 16,diciembre 2008 - 18:28
Hi Piet,
This works just as expected.
s is
string
=
Crypt
(
"This is an encoded string"
,
""
,
cryptNone
,
encodeBASE64
)
Trace
(s)
Trace
(s=
"VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw=="
)
// http://ca.php.net/manual/en/function.base64-encode.php
Trace
(
Uncrypt
(s,
""
,
cryptNone
,
encodeBASE64
)
)
Hope this helps.
Best regards.
Informar
0
0
Piet van Zanten
#3
Publicado el 16,diciembre 2008 - 19:15
Thanks Alexandre,
I forgot the cryptNone. And the reverse function in Windev is different from strrev in php.
In windev:
x
=
edt_Edit1
FOR i
=
1
TO
5
y
=
Crypt
(x,
""
,
cryptNone
,
encodeBASE64
)
x
=
""
FOR j
=
Length
(y)
TO
1
STEP
-
1
x
+
=y[
[j]
]
END
END
edt_Edit2=x
Regards,
Piet
Informar
0
0
stevediaz
#4
Publicado el 30,diciembre 2023 - 09:14
For a simple encryption/decryption between Windev and PHP using base64 encoding:
PHP Functions:
function encode5t($str) {
return base64_encode($str);
}
function decode5t($str) {
return base64_decode($str);
}
Windev Usage:
// Encryption before sending data to PHP
encodedString is string = Base64Encode("YourPasswordToEncrypt")
HTTPRequest("POST", "
https://your-php-endpoint.com
", encodedString)
// Decryption in PHP
<?php
$receivedData = base64_decode($_POST['your_post_variable']);
// ... rest of your PHP code
?>
Replace "YourPasswordToEncrypt" with the actual password or string. For improved security, consider stronger encryption methods, especially for passwords.
You can also check
https://forum.pcsoft.fr/en-US/index.awp/
Informar
0
0
→ Volver a WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versiones precedentes)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Búsqueda Tipo
Sólo temas
Todos los mensajes
Periodo Buscar
Cualquier fecha
Última hora
Última 24 horas
Última semana
Último mes
Último año
Cancelar
Vista previa del mensaje
Añadiendo una imagen
Importar una imagen desde una URL
Enviar una imagen desde un archivo de su disco
Arrastrar un archivo o click en "Examinar..."
o
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto