Wrote protoAuthClient and encap functions