Serialize and encrypt a python object
(self, obj, nonce=None)
| 2039 | return data[: -data[-1]] |
| 2040 | |
| 2041 | def dumps(self, obj, nonce=None): |
| 2042 | """ |
| 2043 | Serialize and encrypt a python object |
| 2044 | """ |
| 2045 | if nonce: |
| 2046 | toencrypt = self.PICKLE_PAD + nonce.encode() + salt.payload.dumps(obj) |
| 2047 | else: |
| 2048 | toencrypt = self.PICKLE_PAD + salt.payload.dumps(obj) |
| 2049 | return self.encrypt(toencrypt) |
| 2050 | |
| 2051 | def loads(self, data, raw=False, nonce=None): |
| 2052 | """ |