• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

Is there a way to determine if a string is RSA encrypted?

I have a function that will encrypt an decrypt using System.Security.Cryptography and the RSA algorithim.  Is there a way to determine if the string is already encrypted?
0
Elliott Ward
Asked:
Elliott Ward
  • 2
  • 2
1 Solution
 
CodeCruiserCommented:
One way is to try to decrypt it and if its succeeds then its encrypted.
0
 
Carlos VillegasFull Stack .NET DeveloperCommented:
I'm agreed with CodeCruiser, but taking into account that the common use of that algorithm is to encrypt small piece of data maybe you can also rely on the fixed size in bytes (128, 512, etc...) of your data to check if it is encrypted, with little performance penalty, if that is your concern.
0
 
Elliott WardAuthor Commented:
What I am really after is tryiing to figure out if a string field is unencrypted or not.
0
 
CodeCruiserCommented:
There is no magical way of finding that out unless you use some sort of flag to indicate whether or not the field is encrypted.
0
 
Elliott WardAuthor Commented:
No solution was possible but the question was answered completely and accurately
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now