An algorithm for hiding and recovering data using matrices