Since your function returns a string, there is no reason why you cannot add plaintext code to the beginning of the encrypted data that the IsEncrypted function can look for, for example "MD5ENC" + [encrypted text].
The disadvantage of this is that it will allow anyone with an unprocessed string to know which algorithm was used for encryption. But as we continue to recall security through obscurity, it is not security. Anyone should be allowed to know how something was encrypted and has no easy way to break this encryption.
Please note that my use of the word is due .
In any case, to return to my original proposal. The advantage of this is that the longer your input code is in a string, the more the vanishingly tiny chance of it being created accidentally in another unrelated encrypted Base64 will become.
If the encrypted text needs to be decrypted, just clear your standard length encryption identifier code and release ...
One monkey
source share