FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Encryption
Encryption
Débuté par Piet van Zanten, 16 déc. 2008 15:39 - 3 réponses
Connectez-vous…
Piet van Zanten
#1
Posté le 16 décembre 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
Signaler
0
0
Alexandre Leclerc
#2
Posté le 16 décembre 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.
Signaler
0
0
Piet van Zanten
#3
Posté le 16 décembre 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
Signaler
0
0
stevediaz
#4
Posté le 30 décembre 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/
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