added ability to change algorithm when editing existing keys