You can't encrypt the alfresco-global.properties file.
The first line of defence is to ensure that only a limited number of people can read the alfresco config files. And DBAs will typically also restrict which machines can use the alfresco oracle account. If its important to you then you will need to store the credentials or the resource definition elsewhere e.g. as a resource in your app server.
I know we can't encrypt the whole alfresco-global.properties file, my concern is only with the "password" property. For the client I am working with, has a strict policy, so I can't store any password as a plain text.
Can I encrypt the password in the alfresco-global.properties file and through some code decrypt it so that alfresco can use it?
Yes. Or you can use spring instead and inject your own password handling stuff, That's what the linked example above does. However at that point your values will not be persisted across a cluster.