PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 2024
→
Encryption
Encryption
Started by Piet van Zanten, Dec., 16 2008 3:39 PM - 3 replies
Connect yourself…
Piet van Zanten
#1
Posted on December, 16 2008 - 3:39 PM
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
Report
0
0
Alexandre Leclerc
#2
Posted on December, 16 2008 - 6:28 PM
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.
Report
0
0
Piet van Zanten
#3
Posted on December, 16 2008 - 7:15 PM
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
Report
0
0
stevediaz
#4
Posted on December, 30 2023 - 9:14 AM
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/
Report
0
0
→ Go back to WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
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