Fsm State Assignment For Security And Power Optimization