No you cannot encrypt them. In order to complete the flow you would need the correct unencrypted password. Additionally there is no functionality to use the merge fields or normal process where you would be able to decrypt.
If you must encrypt them you will need to use custom metadata or custom settings and build the oAuth process yourself.
Be aware that users with customize application permission can view named credentials, so if your security policy requires that the secrets be hidden from subscribers, then please use a protected custom metadata type or protected custom setting
Storing Sensitive Data