Please do not use a L298 or L923 to drive a modern bipolar stepper motor. Those are ancient and very inefficient DC motor drivers and are totally inappropriate for driving modern stepper motors despite the plethora of pages that show them driving steppers. Modern bipolar steppers require current control drivers which the L29x drivers are not.
Pololu has a great line of modern stepper drivers. Choose a driver based on the motor supply voltage and coil current limit. I like Pololu because they have good instructional pages for each of their products and their prices are reasonable.
The Encoder library makes using rotary encoders like the KY-040 pretty easy. The Encoder library is available for installation via the IDE library manager.