Recent statistics show that malware attacks have been increased by over 97% in the past two years. Among these, a large portion is due to Ransomware, a subset of malware. Ransomware codes are easily available as Ransomware as-a-service (RaaS). Because of it, there is a significant threat to the world, as this is a malware which generates high revenues and is creating a viable criminal business model. Because of this the systems of private companies, individuals, or public service providers are at stake and can suffer a severe disruption and financial loss. There are two methods for the detection and analysis to be done for the detection of ransomware. One is the Static detection approach and the other is the Dynamic detection approach. We have done the detection using the Dynamic approach. This paper focuses on detection of ransomware and benign applications using machine learning algorithms for dynamic detection of ransomware. Our experimentation results show that high accuracy is obtained using the KNN algorithm.