converting encrypted databag to hash