With the ubiquitous use of the Internet, the importance of secure access to computing resources has grown. Many computer systems authenticate users through a password selected by the user. User typing patterns are usually distinct, allowing users to be differentiated and verified through a suitable verification system, and are considered a behavioral biometric. Authentication based on keystroke dynamics has many advantages, such as ease of data acquisition, continuous non-intrusive monitoring, and ease of integration into existing systems. In this paper, we present a convolutional neural network, which we call CNN-Detect, to detect unauthorized users that attempt to access resources by their typing patterns. We test our model on the publicly available CMU keystroke dynamics dataset, after suitable feature engineering. Our proposed model shows significant improvement over other models in the literature, achieving an average equal error rate (EER) of 0.009, and a zero-miss false acceptance rate (ZM-FAR) of 0.027.