PostURL( problem with Encryption

In building a procedure to work with a large incoming post, I’m trying to simulate the post with PostURL(. The URL includes an encrypted identifier which Panorama encrypts and decrypts properly.

But with the encrypted URL, Panorama complains that it’s malformed. After a bit of testing, I found that when the identifier is encrypted, it includes a line break. Removing the line break from the encrypted string eliminates the error from PostURL, but then it has an error when it’s decrypted.

It seems that the line break is always included:
encodebase64(encrypt("9876512345","DaU9bDfLEPBRtRqHr"))

AgELMOrp4oagHJKdcUzKq6VvZdeYBfV9Wf3zMyTnjEX0VfoMSzMgo+rJ8NLyjkGMllgW
VHPXdqtJnGCfkyX0e4E0VUWNCKB6J7rWzySJZcOGwQ==

How can this be overcome?

wraplength – is the maximum line length of the encoded text. A common value is around 70 characters per line. If this parameter is zero there will be no line breaks in the encoded text, however, you should still make sure to manually add a line break at the end of the encoded text. Note: This parameter is optional, if it is left off, a wrap width of 68 is assumed.

It looks like you just need to include that wraplength parameter, and make it zero.

1 Like

Hopefully Dave’s suggestion will solve the problem for you. However, I wonder about your approach of putting encrypted data into a URL.

Am I understanding that this is something you are building into a server? So you control both ends of the communication? If so, my thought is that it is not best practice to put encrypted data into the URL itself. At any rate, I’ve never seen that done. Instead, why not put the encrypted identifier into a post parameter?

wraplength is the solution. Thanks David.

I do not control both ends of the communication. The posts are coming from a server over which I have no control other than to influence the configuration of the incoming data. An encrypted identifier is encoded into the URL from which it is decrypted and parsed for use in the cgiExtraParameters.

PostURL came into play in order to simplify the building process for the receiving procedure. Rather than having to submit a form from another machine for every one of the many hits the construction requires, I can trigger them locally and instantly.

I guess now I can no longer say I’ve never heard of it being done that way. You learn something new every day.