0

I have Googled and looked on SOF for a solution but sadly I'm a little confused on how to resolve this issue,

For Encryption I'm using the following

Simple insecure two-way "obfuscation" for C#

The way I use this the end user choose a category and saves the item, on returning from the DB I select the relevant view to be display.

The view name is then Encrypted and passed to a new action.

Within this Action I then try to decrypt the encrypted view name and pass it to the view to be rendered but when I try to decrypt it I get this error mentioned above, I'm uncertain on how to fix this.

My controller looks like this

             return RedirectToAction("Description", "Advert", new{
                        encryptedView = crypto.Encrypt(advertModel.View),
                    });

which passes the following encryption

too8kmao3odfbwbhlaod1w==

I then try the following in the action its been redirected to

var decryptView = new Crypto().Decrypt("too8kmao3odfbwbhlaod1w==");

yet with no avail.....

Community
  • 1
  • 1
Code Ratchet
  • 5,758
  • 18
  • 77
  • 141

1 Answers1

1

Ok, found the solution as im using a nuget LowercaseRoutesMVC when I encrypt it, it looks like this

Too8KMao3ODfBWBHLaoD1w==

When I try to decrypt its lower case as mentioned above which is what causes the issue.

I'll have to think of another way to resolve this.

Code Ratchet
  • 5,758
  • 18
  • 77
  • 141
  • Thanks for reporting back. You can leave the question and answer and accept the answer after a while. It seems that this is an issue that is easily configurable in the framework so maybe others get caught in the same trap. – Maarten Bodewes Dec 07 '14 at 11:01