137
Views
3
Comments
Crypto API
Question

Hey guys, I need help.

I don't want user to see the variable that i pharse in the url. So I tried to encrypt it with crypto API. This is my first time using it. At first its working but then I tried again, there's an error. 

It says "Invalid length for a base-64 char array or string.

This is my encrypt function :

This is the decrypt function :

can someone help, or are there other way to hide the variable I pharse through URL ?


2025-10-10 00-19-44
Bruno Rendeiro

Hy @raven ransford 

You have more ways to do what you desire : https://www.osquay.com/knowledge-center/how-to-deal-with-url-parameters-in-outsystems-to-hide-or-to-validate

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Raven,

Have you debugged your program to see at what point in your app the error is generated? I would assume that after you decrypt the site property's value, you try to decode the Base64 string, and that fails? Can you see what the decrypted value looks like? Does it look like Base64?

Also, in your examples it seems that for the Encrypt, you specify an Encoding value, while you don't on the Decrypt. Also, on the Decrypt, you have the same value as in the Encrypt, I assume this is just an example? Because otherwise it obviously doesn't work.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.