Changed output method for decrypting

can now specify where decrypt output goes
fixes testcases by returning data rather than message to user