0

I am trying the wipe off sensitive data in iPhone app after done with it. Specially the NSStrings I am using to hold passwords etc. Can I use memset for this ?

rustylepord
  • 5,681
  • 6
  • 36
  • 49
  • 1
    Please show the code that you use to do `memset`. – Sergey Kalinichenko Jun 30 '14 at 14:34
  • No, unless you *really* know what you're doing and are *very* careful (and understand you're violating all sorts of Apple rules), using memset on an NSString would be virtually suicidal. You *might* be able to achieve your desired functionality by using NSMutableStrings and setting them to garbage after use, but you have no guarantees that internally they're not buffer swapping. Perhaps a safer/simpler approach would be to simply fill memory with garbage, though there would be no guarantees there either. – Hot Licks Jun 30 '14 at 15:09
  • @HotLicks can you give some sort of code example that how will you fill memory with garbage. I am in need of same kind of help. – Satish Mavani Mar 16 '20 at 12:53
  • @rustylepord Did you manage to solve your problem? If yes would you mind sharing the answer here which can be helpful to others? – Satish Mavani Mar 16 '20 at 12:54
  • @SatishM If you are doing this throughout the app you need to be extra careful , this can introduce lot of crashes. Therefore I gave up the idea. – rustylepord Mar 17 '20 at 07:04

0 Answers0