I wanted to password-protect a PDF in Preview via the "Edit Permissions ..." dialog. I used a simple random password generator to create a reasonably secure password ... only to get it rejected with a "Password contains invalid characters" error message, repeatedly.
Through trial and error, I discovered that it actually doesn't like it when the password is too long. A 32-character password is fine, but a 33-character one produces this error.
This seems counter to many security recommendations, though. And arguably, the error message should tell you what's actually wrong; the current one is misleading. But I digress.
If there really are "illegal characters", which ones are they?
(I suppose it would be useful to understand whether the restrictions on allowed passwords are dictated by the actual PDF spec, or just an arbitrary bug which Apple could fix, but that's bonus points territory.)
I searched the Apple forums for any mention of this problem, but I seem to be the only one who is wondering about this. I also consulted Adobe's documentation for PDF Reader, but that doesn't mention any restrictions on allowable passwords, either.
This is on an up-to-date MacOS Monterey (12.5) installation.