Dear All,
I use MariaDB and I got a problem with HB_Crypt( cPass, cKey ) and store in column (Latin1). When I use HB_Decrypt( oRs:cEncPass, cKey ), it returns incorrect.
What kind of Charactor does support HB_Crypt() or How do I store HB_Crypt and HB_Decrypt() back correctly in MariaDB column.
Thanks in advance for any help or idea.
HB_Crypt() is not compatible with Latin1
HB_Crypt() is not compatible with Latin1
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: HB_Crypt() is not compatible with Latin1
Works with any language.
Try this test:
![Image](https://imagizer.imageshack.com/v2/xq90/922/obHT5C.png)
Try this test:
Code: Select all | Expand
#include "fivewin.ch"
function Main()
local oCn, oRs, cSql, aData
local cKey := "abcdefgh"
aData := { { "English", "English" }, { "Thai", "ไทย" }, { "Telugu", "తెలుగు" }, {"Hindi", "हिंदी" } }
oCn := FW_DemoDb( 6 )
oCn:DropTable( "testcrypt" )
TEXT INTO cSql
CREATE TABLE `testcrypt` (
`id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` varchar(20),
`pass` mediumblob
)
ENDTEXT
oCn:Execute( cSql )
oCn:lShowErrors := .t.
? oCn:Insert( "testcrypt", "name,pass", { ;
{ aData[ 1, 1 ], HB_Crypt( aData[ 1, 2 ], cKey ) }, ;
{ aData[ 2, 1 ], HB_Crypt( aData[ 2, 2 ], cKey ) }, ;
{ aData[ 3, 1 ], HB_Crypt( aData[ 3, 2 ], cKey ) }, ;
{ aData[ 4, 1 ], HB_Crypt( aData[ 4, 2 ], cKey ) } ;
} )
oRs := oCn:RowSet( "testcrypt" )
XBROWSER oRs COLUMNS "id", "name", { || HB_DeCrypt( oRs:pass, cKey ) }
oCn:Close()
return nil
![Image](https://imagizer.imageshack.com/v2/xq90/922/obHT5C.png)
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: HB_Crypt() is not compatible with Latin1
Dear Master,
This column type (MEDIUMBLOB) is working properly. Thank you so much.
This column type (MEDIUMBLOB) is working properly. Thank you so much.
nageswaragunupudi wrote:Works with any language.
Try this test:Code: Select all | Expand
#include "fivewin.ch"
function Main()
local oCn, oRs, cSql, aData
local cKey := "abcdefgh"
aData := { { "English", "English" }, { "Thai", "ไทย" }, { "Telugu", "తెలుగు" }, {"Hindi", "हिंदी" } }
oCn := FW_DemoDb( 6 )
oCn:DropTable( "testcrypt" )
TEXT INTO cSql
CREATE TABLE `testcrypt` (
`id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` varchar(20),
`pass` mediumblob
)
ENDTEXT
oCn:Execute( cSql )
oCn:lShowErrors := .t.
? oCn:Insert( "testcrypt", "name,pass", { ;
{ aData[ 1, 1 ], HB_Crypt( aData[ 1, 2 ], cKey ) }, ;
{ aData[ 2, 1 ], HB_Crypt( aData[ 2, 2 ], cKey ) }, ;
{ aData[ 3, 1 ], HB_Crypt( aData[ 3, 2 ], cKey ) }, ;
{ aData[ 4, 1 ], HB_Crypt( aData[ 4, 2 ], cKey ) } ;
} )
oRs := oCn:RowSet( "testcrypt" )
XBROWSER oRs COLUMNS "id", "name", { || HB_DeCrypt( oRs:pass, cKey ) }
oCn:Close()
return nil
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)