Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

StringEncryption

Zhang edited this page Feb 25, 2020 · 2 revisions

Pass -mllvm -enable-strcry to enable. Unlike Armariris , we provide support for ObjC-Style strings and better over-all security.

Implementations

  • We "unfold" ConstantExpressions into Instructions for all functions.
  • We collect all strings used in this function and "copy" them, modify all uses to our copy
  • We also create a new GV marking status of if the copies have been decrypted.
  • We insert detection as well as decryption code at function start.Note this is done atomically so it should be thread-safe(Hopefully).
  • We write flag back to mark the GVs have been decrypted(Also atomically).
  • We clean-up uses and erase the original GV if it's no longer used

Note

  • StringEncryption Protected Function's first entry is NOT THREAD SAFE! See #80 for a detailed write-up in case you think you've come up with some clever implementation to work around this issue