Add JB-style encryption support

Change-Id: I8332fa250e3f10d6e98373bd6fc6768aee7eee34