You can take a look at this code snippet. However - note that keeping state in the chaincode is generally not a good idea and it is advised not to store state that is reused across chaincode invocations.
In the future there might be a built-in crypto library to be used by the chaincode developers.
It's also possible to just use the encryption in Go's crypto libraries as well