Security patch 001

Primary data security patch and functionality, see commit comments for more details