1. suresh Baggam
  2. PowerBuilder
  3. Monday, 14 December 2020 13:05 PM UTC

In Power builder, I want to know API used to covert base64 Encrypted value to Decrypted actual string in power builder

Below is encrypted string value:

pw="3K1rUYBtc8mTlewC/mzLNhMEVCBPsbi5+lt6xw01LMM="

This need to be decrypted string value:

pw="FTMUser123" 

I am looking for API or a sample program  in power builder which decrypt the encrypted base64 string. 

Thanks in Advance for your help.

Accepted Answer
Arnd Schmidt Accepted Answer Pending Moderation
  1. Monday, 14 December 2020 14:11 PM UTC
  2. PowerBuilder
  3. # Permalink

mmhh. , already there?

https://docs.appeon.com/pb2019/powerscript_reference/ch10s38.html

Example from the Help:

Blob lblb_data
String ls_Base64Str

CoderObject lnv_CoderObject
lnv_CoderObject = Create CoderObject

//ls_Base64Str = lnv_CoderObject.Base64Encode(Blob("Test Base64", EncodingANSI!))
ls_Base64Str = "VGVzdCBCYXNlNjQ="

lblb_data = lnv_CoderObject.Base64Decode(ls_Base64Str)
messagebox("Base64Decode", string(lblb_data, EncodingANSI!))

hth

Arnd

Comment
There are no comments made yet.
suresh Baggam Accepted Answer Pending Moderation
  1. Tuesday, 15 December 2020 11:32 AM UTC
  2. PowerBuilder
  3. # 1

Hi Arnd,

 

Thanks for sharing the API info for string base64 decryption which helped me.

I have one more query, we are using AES encryption as well. we need a decryption API for AES encrypted string.

I have attached the sample API's we use AES Encryption to encrypt and decrypt strings

Please share the sample application or API details or related links if you have any.

 

Thanks,

Suresh

+91 9632258053

 

 

  

 
 
Attachments (1)
Comment
  1. Arnd Schmidt
  2. Tuesday, 15 December 2020 12:11 PM UTC
In PowerBuilder 19 you can use .NET Classes from assemblies.

This way, you can use your EncryptDecrypt.EncryptandDecrypts from a simple DLL.

Is there any need to transform this code to "pure" PowerBuilder Code (aka PowerScript)?



If you want to transform this to PowerBuilder Code, the crypter object is your friend.

https://docs.appeon.com/pb2019r2beta/objects_and_controls/ch02s15.html

Take a look at the SymmetricEncrypt/SymmetricDecrypt functions.

  1. Helpful
  1. suresh Baggam
  2. Tuesday, 15 December 2020 14:21 PM UTC
I have used the .Net Com Dll in power builder code and it worked. Thanks for your quick replays :)
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.