I am a final year student currently doing my project, the title is "Mitigating man in the middle attacks using ssl+symmetric key algorithm". I would like to create my own encryption algorithm. I need to know that could I write it in C, and how to generate an ssl key and to write an encryption algorithm and then to combine them both?
It is possible to add a symmetric crypto algorithm to OpenSSL. There is an example algorithm called GOST included in modern OpenSSL distributions; this page talks a tiny bit about integrating it from a separate package, which would be a good first step for you if you want to learn how to integrate your own algorithm.
That being said, while this would be a useful and interesting learning tool, never implement your own crypto algorithm for actual secure use.