Sage has the following built-in cryptosystems:
HillCryptosystem LFSRCryptosystem ShiftCryptosystem ShrinkingGeneratorCryptosystem SubstitutionCryptosystem TranspositionCryptosystem VigenereCryptosystem
Full documentation is here.
You can adapt the example cells below to use any of these.
Note: The VigenereCryptosystem has the syntax VigenereCryptosystem(alphabet,n)
where $n$ is the length of the key. Similarly, HillCryptosystem and TranspositionCryptosystem also require inputting an integer $n$.
Caesar Encryption
Caesar Decryption
Vigenere Encryption
Vigenere Decryption