added stream cipher code and explanations for other code