libdvbcsa is a free and portable implementation of the DVB Common Scrambling algorithm with decryption and encryption capabilities.