Home     |     Java    |     Php General    |     Oracle Database    |     Oracle Server  

MS Dynamics CRM 3.0

  •  Setting up and Configuring Microsoft Dynamics CRM 3.0
  •  Managing Security and Information Access
  •  Entity Customization: Concepts and Attributes
  •  Entity Customization: Forms and Views
  •  Entity Customization: Relationships, Custom Entities, and Site Map
  •  Reporting and Analysis
  •  Workflow
  •  Server-Side SDK
  •  Client-Side SDK
  •  Integration with External Applications
  • Cervo Technologies
    The Right Source to Outsource

    Sharepoint Portal Server KB

    Microsoft CRM Info

    WPF Interview Questions

    SilverLight Interview Qs

    Asp.Net 2.0 Interview Qs

    Asp.NET 1.1 FAQs

    Oracle Interview Questions

    SAP Interview Questions

    Oracle Database

    Encryption in Oracle , decryption in Java


    Hi

    I encountered a problem not sure how to solve it. please help if
    possible.

    in oracle9 I do a simple encryption (using DES) that gives me the
    following RAW:

    F26D94ECDACDBD111584C7A8A9018A5C

    when decrypted I get 36463643363133313332333333343335 which is
    correct.

    However in java when I try decrypting the
    'F26D94ECDACDBD111584C7A8A9018A5C' I get this:

     3646364336313331c15fa7dfe9f98e24

    First 8 bytes are exactly the same, the other 8 bytes differ, why ?

    In Java I use the following code:

    Cipher dcipher = null;

    dcipher = Cipher.getInstance("DES/ECB/NoPadding");

    SecretKey myKey = new SecretKeySpec(_key, "DES");

    dcipher.init(_cryptMode, myKey);

    return dcipher.doFinal(_buffer);

    Obviously keys in both encryption and decryption are the same.

    Thanks for any hints.

    On May 10, 10:13 am, schw <schwa@alpha.net.pl> wrote:

    Why would you decypher that data in a different place than the one you
    encrypted it in? Isn't that breaking the concept of a service?

    -----------------------------------------------Reply-----------------------------------------------
    On May 10, 6:13 pm, schw <schwa@alpha.net.pl> wrote:

    I believe Oracle's implementation of DES in DBMS_OBFUSCATION_TOOLKIT
    uses CBC mode, not ECB. This is why the first 64-bit block comes out
    the same (the same initial state and key,) but all subsequent blocks
    differ. Try decrypting with Cipher.getInstance("DES/CBC/NoPadding"),
    this should work.

    Hth,
       Vladimir M. Zakharychev
       N-Networks, makers of Dynamic PSP(tm)
       http://www.dynamicpsp.com

    Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc