change encoding order & add GCM