when storing back the data field 'encrypted' it is necessary to cast the boolean to an integer to make pg happy