optimize for encrypting class without package