Cryptography can be used in prevent data, one of the preventive measures is by encoding messages. Cryptography is the study of encoding messages or ways of data protection. In encoding the content of messages, there is an algorithm conventionally used nowadays, the RSA (Rivest-Shamir-Adleman) algorithm. The RSA algorithm is a method that has two different keys for each encryption and decryption process but is still interrelated to maintain security in processing the data. In finding the key, the RSA algorithm utilizes the rule of prime number. The larger the prime number used as a key, the harder it is to find a large number as a factor. This research describes the process of encrypting text messages, the content of documents using the RSA algorithm, and the key generation process. Those processes are done by converting plaintext into ciphertext using ASCII code, which is 256 long, and using PKCS (Public Key Cryptography Standards) is the encryption process on the RSA algorithm. This study uses Pyhton programming language to implement the RSA algorithm on text messages and documents. As a recommendation to the subsequent studies, it is proper to use algorithms or other programming languages to secure messages.