code: def seal_aes_ctr_legacy(key_service, secret, digest_method=DEFAULT_DIGEST):
      
      # generate a a 64 byte key.
      # Half will be for data encryption, the other half for HMAC
      key, encoded_key = key_service.generate_key_data(64)
      ciphertext, hmac = _seal_aes_ctr(
          secret, key, LEGACY_NONCE, digest_method,
      )
      return {
          'key': b64encode(encoded_key).decode('utf-8'),
          'contents': b64encode(ciphertext).decode('utf-8'),
          'hmac': codecs.encode(hmac, "hex_codec"),
          'digest': digest_method,
      }
docs: Encrypts `secret` using the key service.
      You can decrypt with the companion method `open_aes_ctr_legacy`.