sparse encryption in two modes