In the UK, it's illegal to encrypt for the purposes of obscuring communication. There was a lot of noise about G3RUH modems in the olden days when 9600bps packet was starting out, because they used a "scrambler" to whiten the spectrum of the data being sent, and people assumed that meant it was using a secret key to encrypt traffic.
I mean, in a sense it was - you're trying to make thing with long runs of patterns look as much like noise as possible, which is the goal of encryption - but in order for it to work as a modem both ends have to have the same "key" which was a very short LFSR that would pull into sync during the training burst.
In practice, at least in the UK, you can more-or-less do what you like as long as you're not making a nuisance of yourself. You literally cannot pay Ofcom to investigate anything on the amateur bands, although you might get a lot of grumbling from daft old bastards.
I do think that encryption is firmly outside of the amateur culture in most cases, but legality is well covered here: https://www.n5dux.com/ham/files/pdf/Data%20Encryption%20is%2...