Encrypt password with security command
The “encryption” used for WiFi passwords is really just a part of the WiFi security protocol. I.e. it is a kind of precalculation of what would otherwise happen when you attach to a WiFi network. This is very specific to WiFi.

If you did the same “precalculation” for a SMB password, it wouldn’t work anymore and it can’t be used for logging on to SMB shares.