Usage patterns
〈事〉を暗号で送るto send something in code
We sent the important information in code.
暗号を解くto decipher/crack a code
It took the expert three days to crack the code.
暗号を設定するto set a password
I set a password for the new account.
暗号がばれるfor a code/password to be found out or leaked
The enemy found out our code.