-3

I want to encrypt a single column of a csv file.I able to encrypt entire csv file,but I want to encrypt a single column from that csv file.How can I do that.

Thanks in advance

user3424829
  • 121
  • 1
  • 3
  • 10

1 Answers1

0

I think the cleaner approach would be to read the whole file, then you need to encrypt the item you want to encrypt and write back the csv.

To easily do that you could you a library that read/write CSVs, like FileHelpers (here is the Quick Start page).

Otherwise you could implement it by yourself, there's plenty of resources like this one.

To Encrypt the field, it depends if you need a symmetric or asymmetric encryption and the type of field.

If it's a string and you need a symmetric encryption, you could have a look at this answer on StackOverflow.

Community
  • 1
  • 1
AleFranz
  • 771
  • 1
  • 7
  • 13