This is a multi-part message in MIME format.

------=_NextPart_000_0004_01C01335.CD48D230
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Does anyone know if there is a custom tag that can be called from both Java
and Cold Fusion that will do encryption?

We need to encrypt credit card numbers with Cold Fusion and then decrypt
them from Java and Cold Fusion.

I have tried to write a custom tag that will do the encryption, but have
failed. I can get the custom tag to encrypt and decrypt in Cold Fusion, but
not in java even though it is calling the same class and everything. I try
to output the encrypted value in Java and after it is passed to Cold Fusion
and the results are different is different.

If I pass 1234567890123456 with the key of testing. Java says that the
encrypted form is $xx20^4Qm+SN}Bv"w'RKzt'H$CQujyw> Cold Fusion says that the
encrypted form is ]Us|2^{[Bl7NA2XAC'kt+&~H!j7jiyE7

Does anyone know why this is being converted as it is coming from java and
the custom tag to cold fusion and the output. The java code is below. (It
creates a query to return the results (could that have anything to do with
the problem???)). Thank you for your help.




Attachments: public void processRequest( Request request, Response
response ) throws Exception
  {
      // validate that required attributes were passed
      if (!request.attributeExists( "STRING" ) ||
          !request.attributeExists( "KEY" ) ||
          !request.attributeExists( "ACTION" ))

      {
         throw new Exception(
            "Missing attribute (STRING and KEY and ACTION are all " +
            "required attributes for this tag)" ) ;
      }
     // get attribute values
      System.err.println("Using : " + request.getAttribute( "STRING" ));
      String strString = request.getAttribute( "STRING" );
      String strKey = request.getAttribute( "KEY" );
      String strAction = request.getAttribute( "ACTION" );

      Query results;
      try
      {
        String[] fields={"String"};
        results=response.addQuery("ENCRYPTED", fields);
      }
      catch(IllegalArgumentException e)
      {
        throw new Exception("Failed to create query") ;
      }


      if(strAction.compareToIgnoreCase("Encrypt")==0)
      {
        results.addRow();
        results.setData(1,1,encrypt(strString, strKey));
        response.write("String " + strString + "<br>");
        response.write("Key " +  strKey + "<br>");
        response.write(encrypt(strString, strKey) + "<br>");
      }
      else if(strAction.compareToIgnoreCase("Decrypt")==0)
      {
        results.addRow();
        results.setData(1,1,decrypt(strString, strKey));
        response.write("String " + strString + "<br>");
        response.write("Key " +  strKey + "<br>");
        response.write(decrypt(strString, strKey) + "<br>");
      }
  }




------=_NextPart_000_0004_01C01335.CD48D230
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>
<P>Does anyone know if there is a custom tag that can be called from =
both Java=20
and Cold Fusion that will do encryption?=20
<P>We need to encrypt credit card numbers with Cold Fusion and then =
decrypt them=20
from Java and Cold Fusion.=20
<P>I have tried to write a custom tag that will do the encryption, but =
have=20
failed. I can get the custom tag to encrypt and decrypt in Cold Fusion, =
but not=20
in java even though it is calling the same class and everything. I try =
to output=20
the encrypted value in Java and after it is passed to Cold Fusion and =
the=20
results are different is different.=20
<P>If I pass 1234567890123456 with the key of testing. Java says that =
the=20
encrypted form is $xx20^4Qm+SN}Bv"w'RKzt'H$CQujyw&gt; Cold Fusion says =
that the=20
encrypted form is ]Us|2^{[Bl7NA2XAC'kt+&amp;~H!j7jiyE7=20
<P>Does anyone know why this is being converted as it is coming from =
java and=20
the custom tag to cold fusion and the output. The java code is below. =
(It=20
creates a query to return the results (could that have anything to do =
with the=20
problem???)). Thank you for your help.=20
<P>
<P>
<P>
<P><B>Attachments:</B>=20
<TABLE width=3D"100%" border=3D1>
  <TBODY>
  <TR>
    <TD><XMP>public void processRequest( Request request, Response =
response ) throws Exception
  {
      // validate that required attributes were passed
      if (!request.attributeExists( "STRING" ) ||
          !request.attributeExists( "KEY" ) ||
          !request.attributeExists( "ACTION" ))

      {
         throw new Exception(
            "Missing attribute (STRING and KEY and ACTION are all " +
            "required attributes for this tag)" ) ;
      }
     // get attribute values
      System.err.println("Using : " + request.getAttribute( "STRING" ));
      String strString =3D request.getAttribute( "STRING" );
      String strKey =3D request.getAttribute( "KEY" );
      String strAction =3D request.getAttribute( "ACTION" );

      Query results;
      try
      {
        String[] fields=3D{"String"};
        results=3Dresponse.addQuery("ENCRYPTED", fields);
      }
      catch(IllegalArgumentException e)
      {
        throw new Exception("Failed to create query") ;
      }


      if(strAction.compareToIgnoreCase("Encrypt")=3D=3D0)
      {
        results.addRow();
        results.setData(1,1,encrypt(strString, strKey));
        response.write("String " + strString + "<br>");
        response.write("Key " +  strKey + "<br>");
        response.write(encrypt(strString, strKey) + "<br>");
      }
      else if(strAction.compareToIgnoreCase("Decrypt")=3D=3D0)
      {
        results.addRow();
        results.setData(1,1,decrypt(strString, strKey));
        response.write("String " + strString + "<br>");
        response.write("Key " +  strKey + "<br>");
        response.write(decrypt(strString, strKey) + "<br>");
      }
  }</XMP></TD></TR></TBODY></TABLE></FONT></P></DIV></BODY></HTML>

------=_NextPart_000_0004_01C01335.CD48D230--

------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with 
'unsubscribe' in the body or visit the list page at www.houseoffusion.com

Reply via email to