Thursday, April 9, 2020

Decrypt AES encrypted Password in WCS

                   How to Decrypt AES encrypted Password in WCS 

package com.xyz.commerce.me.datatype;

import com.ibm.commerce.ejb.helpers.nc_crypt;
import com.ibm.commerce.util.wrapper.AES128Cryptx;

public class test {
        public static void main(String[] args) throws Exception {

                System.out.println("merchantKey         ");
               
                String key = "PxrEn69MEqvE4rGLFnQoxZl6VAbbxVvQp2bPrDKxAYX=";
                System.out.println("str length         " + key.length());

//TO decrypt merchent key in CustomKeys.xml

                String keyFileValue = "HuRIPYJ92f5mf1iMUDqTLivbros95jcCNTWSjcgDh/dCbdAn9LR+JEEn7X3PsHkhUk+zl6XhSU2rH0RtwKBgwg=="; //value present in keyFile file.
                String KeyEncryptionFileValue= "1234567890abcdef1234567890abcdef"; //Value present in keyEncryptionFile file.


                String decryptedMerchantKey = AES128Cryptx.decrypt(keyFileValue,KeyEncryptionFileValue, false) ;

//Printing decrypted merchant Key
                System.out.println("Decrypted Merchant Key : " +  decryptedMerchantKey);
                String stringToDecrypt = "PxrEn69MEqvE4rGLFnQoxZl6VAbbxVvQp2bPrDKxANM=";//String to decrypt

//printing decrypted password using merchant key

                System.out.println("Decrypted String : " + AES128Cryptx.decrypt(stringToDecrypt,decryptedMerchantKey,false));

        }
}

1 comment:

  1. 68704C4465587A594C3356686F7969706666586875794830584C567A6E6D2F6D756E43436354756A3161303D202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020

    ReplyDelete