Does anyone know if there is a way to (on a very basic level) validate the content of an encrypted value?

  • I have a string value that is encrypted
  • I know that the content of the encrypted value should only contain digits and it should always be 16 characters long
  • I do not have access to (and is neither interested in having access to) the decryption key. The actual value is not of interest to me, only that it the value has the right format (before passing it on).
  • I can state encryption technology to be used, in case it will help me validating the format of the content
  • The technology available for validating the content in the string is Java.

Is it doable to do this type of validation of the content, without actually using decryption to see the clear text value (which basically would make me fail in my task, since I am not allowed to view the clear text value, only validate its format)

migrated from stackoverflow.com Nov 27 at 17:48

This question came from our site for professional and enthusiast programmers.

  • you can use FFX to guarantee the 16 characters, or a block cipher bit 64-bit block-size. – kelalaka Nov 21 at 15:09
  • What is the use-case? Are you trying to detect bad players spamming the system with invalid data? – Thilo Nov 21 at 15:19
  • Yes, correct. It is basically a gateway where I want to limit what the encrypted value may contain, even if it has no access to decrypt the value. In that way I will feel somewhat secure that I do not forward any injection attempts (for instance) to the application that will decrypt the value. – Kristian Sahlin Nov 21 at 16:06
  • 1
    Maybe it's easier to hand out API keys or the like, so that you can see who is sending these packets and police them that way (revoke bad actor's tokens). – Thilo Nov 22 at 9:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.