It would be more clever and realistic to give everyone a different code, so if a ship gets lost its code must be invalidated, but all other ships aren't affected. Furthermore, activating an IFF should require a password only the pilot knows, and if the pilot dies the IFF self-destructs.