Updated crypto_box_afternm wrapper with GetByteArray and safety checks