Question: I'm working on malware analysis at my university and I'm trying to develop ransomware. I'm planning to publish the source code after it's finished. Is there any open source ransomware sample so I can take a look?

Answer: 
There is an open source ransomware called [Hidden Tear](https://github.com/utkusen/hidden-tear). The code encrypts files with the following extensions: ".txt", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".odt", ".jpg", ".png", ".csv", ".sql", ".mdb", ".sln", ".php", ".asp", ".aspx", ".html", ".xml", ".psd" by default with AES 256 bit encryption. 

It is open source so it could be easily customized to not only look for additional files but also the way encryption is done.
You can visit [this](https://github.com/roothaxor/Ransom) link:

You will be able to understand how the ransomware works in encrypting and decrypting files. It's written in C and Python too. Good luck!