cancel
Showing results for 
Search instead for 
Did you mean: 

How to encrypt single field in a file

sahithi_moparthi
Contributor
0 Kudos


Hi,

  I have a scenario where i have to encrypt a single field in the file ?Could you please suggest best approach to design this interface.

Data :

File is coming with Bank and credit card details like:

<Record>

    <Field1> Creditcard Number </Field1>

   <Field2> Bank Name</Field2>

   <Field3> Address </Field3>

</Record>

I have to encrypt creditcard number only.How is it possible?

AFAIK with PGP encryption we can encrypt whole payload.

Please provide your valuable inputs.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184720
Active Contributor
0 Kudos

Have a look at the below blog -

sahithi_moparthi
Contributor
0 Kudos

Hi Hareesh,

I have gone through the document and that is the exact scenario i'm looking.I have a query on the Jar libarraies mentioned in the document.

when i'm implementing the scenario,i could not find the Jar files mentioned in the document.

 

com.sap.aii.af.cpa.svc.api.jar: <bin>/services/com.sap.aii.af.cpa.svc/lib

com.sap.aii.af.lib.mod.jar: <bin>/ext/com.sap.aii.af.lib\lib

com.sap.aii.af.ms.ifc_api.jar: <bin>/interfaces/com.sap.aii.af.ms.ifc/lib

com.sap.aii.af.svc_api.jar: <bin>/services/com.sap.aii.af.svc/lib

sap.com~tc~logging~java~impl.jar: <bin>/system

I have found the jar files in NWDS -> Plugins,but the libraries seems different than above:

Also tried to download the Jar files online but could not find the right one.

Please suggest where to get the jar files mentioned above to start the interface.

Thanks a lot for your timely response!!!

Regards,

Sahithi M

maheswarareddykonda
Active Contributor
0 Kudos

Hi Sahithi,

Please use the below code and map as per that screenshot.

and before you start write the code, pls import an jar/zip file in import archives in same namespace.

and add that as mentioned below

also dont forget add imports in import instructions(sun.misc.BASE64Encoder)

Note: you can get jar file from link : Download sun.misc.BASE64Decoder.jar : sun&amp;nbsp;&amp;laquo;&amp;nbsp;s&amp;nbsp;&amp;laquo;&amp;...

sahithi_moparthi
Contributor
0 Kudos

Hi Mahesh,

I tried the same logic,but getting below error.

Please suggest ?

maheswarareddykonda
Active Contributor
0 Kudos

Sahithi,

Have you added jar in Archive used tab ?

sahithi_moparthi
Contributor
0 Kudos


Hi,

Yes,

azharshaikh
Active Contributor
0 Kudos

Hi,

1.In your UDF Encrypt, change the argument Name to input instead of encoder

2. Remove calculate1, calculate2 functions if you are not using it

Regards,
Azhar

sahithi_moparthi
Contributor
0 Kudos

Hi,

Thanks a lot!!

It worked.

Is it possible to decrypt that field ??

maheswarareddykonda
Active Contributor
0 Kudos

yes, as Azhar replied ..you have mentioned argument name and mention in code both are different.

sahithi_moparthi
Contributor
0 Kudos

Hi Mahesh,

Thanks for your inputs.Could you please let me know how to decrypt the same field ?

if i pass that field data to SAP or thirdparty how can they able to identify that field and how can they decrypt  that one ?


maheswarareddykonda
Active Contributor
0 Kudos
if i pass that field data to SAP or thirdparty how can they able to identify that field and how can they decrypt  that one ?

its wont make sence if we do encript and again decript data in PI itself, the reason receiver system people ask is to secure/protect the data and the same time reciever system people should be able to decript the data.

Answers (0)