© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•10mo ago
VoidPointer

Problem Posting Encrypted Image from Postman to ASP.NET API Endpoint

I need a sanity check, please. I'm supposed to post a passport image encoded as base64 then encrypted. Then the endpoint gets the original document back like this:
validateDocument.base64_document = Convert.ToBase64String(cryptLib.decryptByte(Convert.FromBase64String(validatePassportRequest.Base64Document), decryptionKey, decryptionVector, out decryptErr1)); 
validateDocument.base64_document = Convert.ToBase64String(cryptLib.decryptByte(Convert.FromBase64String(validatePassportRequest.Base64Document), decryptionKey, decryptionVector, out decryptErr1)); 

Now because I can't encode the document in Postman, I'm doing it like this using the same keys that are used to decrypt it, and this has always worked before for posting encrypted documents from Postman, but without all the base64 baggage:
var encDoc = cryptLib.encrypt(validatePassportRequest.Base64Document, decryptionKey, decryptionVector);
var b64Doc = Convert.ToBase64String(Security.GetBytes(encDoc));
var encDoc = cryptLib.encrypt(validatePassportRequest.Base64Document, decryptionKey, decryptionVector);
var b64Doc = Convert.ToBase64String(Security.GetBytes(encDoc));

Then I just paste
b64Doc
b64Doc
into my Postman request variable.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

ASP.NET endpoint logging
C#CC# / help
2y ago
❔ ASP.NET routing problem
C#CC# / help
3y ago
✅ Image Postman
C#CC# / help
12mo ago