implement self made crypto stream