here 4658582030164342 is a card number(16 digits) i need to encrypt the number such that only first four and last six digit are
visible, that is the remaining six digit to be replaced by ******. that is
The card number only appears in the +DEF subsection.
There are several such sections that appear in the file apart from the other data.
To summarise the requirement is check for all the DEF subsection in the file look for 11th field (: separated within DEF) or 16 digit numeric in
DEF section if found encrypt card number as above.
Thanks a lot but the issue is here we are checking with DEF section till CN but CN is not the fix two characters that will appear there
it can be any two character
So we have to check for the either the 11th field within DEF separated by : or 16 digit numeric word that appear within DEF section
---------- Post updated at 05:42 AM ---------- Previous update was at 05:38 AM ----------
Additionally it is not that in every DEF section we may get card number, if there is any other data(we can identify it if it is not 16 digit Numeric) we don't need to encrypt
You keep using that word. I do not think it means what you think it means.
It is not encrypting the data, it is destroying the data. Perhaps you mean obscuring? I hope so, since there's no way to get it back once that's done except by having an unobscured copy somewhere else.