Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#46 Encryption issue

open
nobody
None
5
2007-04-11
2007-04-11
No

Hi Kathy / Jörg
Encryption really does not work!
But found a solution…

Apparently the problem is that the encrypt decrypt methods of the SecureEngine doesn’t recognize the object type when invoked. So they use the generic method (which always return what have received – i.e clear text)

Forcing the type in the PO.java before invocation make them to work properly.
Hoping that it helps please found below a proposed solution that works (maybe not the best implementation but works!):

Greets,
Jorge

private Object encrypt (int index, Object xx)
{
if (xx == null)
return null;
if (index != -1 && p_info.isEncrypted(index))
/* Added Distopro */
{
if (xx instanceof String)
{
String sxx = xx.toString() ;
return SecureEngine.encrypt(sxx);
}
/* End Distopro addition */
else
return SecureEngine.encrypt(xx);
}
return xx;
} // encrypt

/**
* Decrypt data
* @param index index
* @param yy data
* @return yy
*/
private Object decrypt (int index, Object yy)
{
if (yy == null)
return null;
if (index != -1 && p_info.isEncrypted(index))
/* Added Distopro */
{
if (yy instanceof String)
{
String syy = yy.toString() ;
return SecureEngine.decrypt(syy);
}
/* End Distopro addition */
else
return SecureEngine.decrypt(yy);
}
return yy;
} // decrypt

Discussion

  • Kathy Pink
    Kathy Pink
    2007-04-11

    • labels: 579470 -->
    • milestone: 656984 -->