developing security algorithm for cognitive networks