secured memwrite