Linked Questions
48 questions linked to/from How to achieve Base64 URL safe encoding in C#?
5 votes
3 answers
5k views
Need an Encryption/decryption method does not have a '/' in the encrypted string [duplicate]
I need to encrypt and decrypt string values such as Email address and numeric values, but the encrypted string should not have a '/' in it because I am using that in a URL and using '/' for a ...
1 vote
0 answers
809 views
Rijndael 256 Encrypt and Decrypt in C# and ASP.net [duplicate]
I am working on a Rijndael256 encrypt and decrypt method in C# and it appears that my encrypt method is "working", however; my decrypt method randomly returns an error about the IV or Data I want to ...
-2 votes
1 answer
268 views
Including encrypted key in url [duplicate]
I have an encrypted url that gets passed in as a query string such as myurl.com/key/cYtLPBlnOUOi+8413hTQLz+GGeoiLeLhbPuNhK+saqhc/f/FgtKSbcInVB9IIoWER71L1Q6vrnLv8o3eKI843|M== I am having issues, I ...
124 votes
5 answers
113k views
Code for decoding/encoding a modified base64 URL (in ASP.NET Framework)
I want to base64 encode data to put it in a URL and then decode it within my HttpHandler. I have found that Base64 Encoding allows for a '/' character which will mess up my UriTemplate matching. ...
131 votes
3 answers
153k views
Decoding and verifying JWT token using System.IdentityModel.Tokens.Jwt
I've been using the JWT library to decode a Json Web Token, and would like to switch to Microsoft's official JWT implementation, System.IdentityModel.Tokens.Jwt. The documentation is very sparse, so ...
28 votes
4 answers
27k views
C# Byte[] to Url Friendly String
I'm working on a quick captcha generator for a simple site I'm putting together, and I'm hoping to pass an encrypted key in the url of the page. I could probably do this as a query string parameter ...
11 votes
2 answers
7k views
What is the difference between Convert.ToBase64String(byte[]) and HttpServerUtility.UrlTokenEncode(byte[])?
I'm trying to remove a dependence on System.Web.dll from a Web API project, but have stumbled on a call to HttpServerUtility.UrlTokenEncode(byte[] input) (and its corresponding decode method) that I ...
7 votes
1 answer
16k views
Using statement for Base64UrlEncode [closed]
I am trying to send an email through code, and I ran into a roadblock. I was working off of this when Base64UrlEncode showed up red. I have the same using statements in my code. using System; using ...
10 votes
2 answers
9k views
How can I read the whole message using Gmail API
I need all the text in the body for incoming email. I tried: var mesage = GetMessage(service, "me", 1); Console.WriteLine(mesage.Snippet); public static Message GetMessage(GmailService service, ...
9 votes
1 answer
6k views
C#: base64url according to RFC4648
I'm looking for a (fast) standard implementation for base64url according to RFC4648 in C#. I found HttpServerUtility.UrlTokenEncode but it looks like this doesn't follow RFC4648 (UrlTokenEncode adds a ...
1 vote
1 answer
10k views
Passing a url encoded byte array
I need to pass a byte array via a URL. So I am encoding it with the UrlEncode Method like this: string ergebnis = HttpUtility.UrlEncode(array); The result is the following string: %00%00%00%00%00%25%...
1 vote
1 answer
5k views
Decrypt Python cryptography fernet token in C#
I have written an encryption function in Python, which works fine. from cryptography.fernet import Fernet def Encryptor(password): key = b'MAKV2SPBNI99212' cipher_suite = Fernet(key) ...
2 votes
1 answer
5k views
How to decode signature part of JSON Web Token
I am having the following JSON Web Token:- eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....
3 votes
2 answers
5k views
ES 512 jwt token verification
I am trying to verify ES512 jwt token using public key which is in string format: I am trying to imitate a sample written for ES256 which is something like this: // The code for ES256 public ...
0 votes
1 answer
4k views
How to encrypt the query parameters values in rest api url
We have created sample web api and hosted in azure. In that we have many get and Post method. We have to get the response through API by passing some sensitive data like SSN and etc. We felt that ...