Last post May 29, 2017 07:20 AM by PatriceSc
Apr 13, 2017 10:02 AM|Rjk_P|LINK
I am working with the QR code , the scenario is QR Code is containing the url , while scan with the QR code scanner is redirected to the url having certain parameters passed in it to display the data on the basis of the parameters
now the issue is the parameters are not encrypted, while i am trying to encrypt the parameters with cryptography QR code is giving error in generation
please help me in this regards , how can i generate the QR code with encrypted information
Apr 13, 2017 11:13 AM|PatriceSc|LINK
It's best to always be explicit about which error message you have (translated in English) and maybe showing as well the line of code on which it happens. For now we can only guess about which error you SEE.
I would say that perhaps you are invalid characters in your url (because of using raw encrypted values in your querystring parameters) making QR code generation to fail ?? Maybe UrlEncode could help.
Not directly related but make sure what encryption brings (anyone scanning the same qr code won't know which values are passed but might be able to use the same url and get the same result than a legitimate user). Another option might be to pass (or add)
a guid value for example that will process this with server side retrieved parameter but then it is easier to "disable" an url if for some reason it has been compromised (or even to change the parameters you want to use if you have to).
Edit: or maybe a string length issue? Once again you should really tell us what happens on your side so that we don't have to start by guessing what is the exact error you see...
May 27, 2017 07:02 AM|Rjk_P|LINK
this is the string which i get after encryption Ufeeh2DmsxEAVc9k%252fK0BzQ%253d%253d
I am using cryptography . I have tried urlencode ... urldecode but still the error is "Invalid character in a Base-64 string."
May 29, 2017 07:20 AM|PatriceSc|LINK
A base64 string shouldn't contain % characters.. So if you pass directly this a value to a method that expects a base64 string it seems expected.
Do you use maybe
https://msdn.microsoft.com/en-us/library/system.convert.tobase64string(v=vs.110).aspx at some point ? Do you even have a bas64 string at some point?