Error Trying to Store AES Encrypted Data in Custom Class (Doc ID 819598.1)

Last updated on JANUARY 31, 2017

Applies to:

Oracle Communications Billing and Revenue Management - Version 7.3.1.0.0 and later
Information in this document applies to any platform.
***Checked for relevance on 23-May-2012***
***Checked for relevance on 31-Aug-2015***
Checked for relevance on 31-Jan-2017.

Goal

Following BRM Documentation at

Programmer’s Guide · Customizing BRM server components: Configuring the Data Manager (DM) for AES encryption


there are some instructions to start working with AES encryption over DM libraries. Steps 3 and 4 are omitted just because we don't want to encrypt the database connection password.

If we use pin_crypt_app key generator and we configure dm with the generated key it seems to work. But we need to migrate data from legacy system and we are not using BRM api. This means that we have to use the standard AES crypting algorithm to imitate the BRM way of storing encrypted data.

We get a 256 bit encrypt key and paste it in the $PIN_HOME/sys/dm_oracle/pin.conf file:

- crypt aes|/usr/users/portal/pin5/7.3.1/lib/libpin_crypt_aes4dm.so "&aes|encryptedencryptedencryptedencryptedencryptedencryptedencryptedd"


Restart BRM and execute the PCM_OP_CREATE_OBJ opcode with the provided flist:

0 PIN_FLD_POID                      POID [0] 0.0.0.1 /payinfo/personal/cc -1 0
0 PIN_FLD_ACCOUNT_OBJ               POID [0] 0.0.0.1 /account 4753402 1
0 PIN_FLD_ACH                        INT [0] 0
0 PIN_FLD_DUE_DOM                    INT [0] 0
0 PIN_FLD_INVOICE_OBJ               POID [0] 0.0.0.1 /invoice -1 0
0 PIN_FLD_INV_TYPE                  ENUM [0] 0
0 PIN_FLD_NAME                       STR [0] "PIN Payinfo Object"
0 PIN_FLD_PAYMENT_OFFSET             INT [0] -1
0 PIN_FLD_PAYMENT_TERM              ENUM [0] 0
0 PIN_FLD_RELATIVE_DUE_T          TSTAMP [0] (0) 01/01/1970 01:00:00:000 AM
0 PIN_FLD_CC_INFO                  ARRAY [0] allocated 5, used 5
1     PIN_FLD_BANK_NO                STR [0] "1"
1     PIN_FLD_DEBIT_EXP              STR [0] "123123"
1     PIN_FLD_DEBIT_NUM              STR [0] "Hi everyone, this is an encrypted field"
1     PIN_FLD_NAME                   STR [0] "Name"
1     PIN_FLD_VALID_FROM          TSTAMP [0] (0) 01/01/1970 01:00:00:000 AM


Notice that the storable class has an encryptable field, we expected data stored with the PIN_FLD_DEBIT_NUM field encrypted, but a DM library error appeared:

E Fri Apr  3 17:10:14 2009  brmRoamD1  dm:25815  dm_subr.c(116):6591 1:TV:UnknownProgramName:0:main:1:1238789144:0
        encrypt_field_value(), pin_crypt4dm shared library not loaded.
E Fri Apr  3 17:10:14 2009  brmRoamD1  dm:25815  dm_sql_mapping.c(79):1967 1:TV:UnknownProgramName:0:main:1:1238789144:0
        binding_info_of_field() encryption failed for field hello everybody, err=15(PIN_ERR_BAD_CRYPT)
E Fri Apr  3 17:10:14 2009  brmRoamD1  dm:25815  dm_do_ops.c(73):1943 1:TV:UnknownProgramName:0:main:1:1238789144:0
        do_create_create m_i_c_l() tbl payinfo_personal_cc_t, field 0/0, err=15(PIN_ERR_BAD_CRYPT)
E Fri Apr  3 17:10:14 2009  brmRoamD1  dm:25815  dm_do_ops.c(73):2195 1:TV:UnknownProgramName:0:main:1:1238789144:0
        do_create_create do_create... field name 9/142, err=15(PIN_ERR_BAD_CRYPT)
W Fri Apr  3 17:10:14 2009  brmRoamD1  dm:25815  dm_subr.c(116):1111 1:TV:UnknownProgramName:0:main:1:1238789144:0

SQL_STMT do_sql: cmd="rollback"
D Fri Apr  3 17:10:14 2009  brmRoamD1  dm:25815  ../dm_oracle_stmt_cache.c:324 1:TV:UnknownProgramName:0:main:1:1238789144:0
        PINStmtPrepare: SQL Statement = rollback
        audsession-id: 2836579; Statement-id: 1076425096;
D Fri Apr  3 17:10:14 2009  brmRoamD1  dm:25815  ../dm_oracle_stmt_cache.c:334 1:TV:UnknownProgramName:0:main:1:1238789144:0
        audsession-id: 2836579; Statement-id: 1076425096; Time taken by OCIStmtPrepare = 0.039101 milliseconds
D Fri Apr  3 17:10:14 2009  brmRoamD1  dm:25815  dm_if_oracle.c(110):625 1:TV:UnknownProgramName:0:main:1:1238789144:0
        audsession-id: 2836579; Statement-id: 1076425096; Time taken by OCIStmtExecute = 1.045942 milliseconds
D Fri Apr  3 17:10:14 2009  brmRoamD1  dm:25815  dm_if_oracle.c(110):5477 1:TV:UnknownProgramName:0:main:1:1238789144:0
        End of opcode PCM_OP_CREATE_OBJ
D Fri Apr  3 17:10:14 2009  brmRoamD1  dm:25815  dm_if_oracle.c(110):5479 1:TV:UnknownProgramName:0:main:1:1238789144:0
        audsession-id: 2836579; Time taken by PCM_OP_CREATE_OBJ = 16.426086 milliseconds
E Fri Apr  3 17:10:14 2009  brmRoamD1  dm:25815  dm_back.c(25):1389 1:TV:UnknownProgramName:0:main:1:1238789144:0
        DMbe #5: process_op: op 1, err 15

 

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms