# import tls_client
#
# session = tls_client.Session(client_identifier='chrome_112')
# url = "https://jbrest.jetblue.com/lfs-rwb/outboundLFS"
# data = {
#     "tripType": "oneWay",
#     "from": "LAS",
#     "to": "BOS",
#     "depart": "2023-09-10",
#     "cabin": "economy",
#     "refundable": False,
#     "dates": {
#         "before": "3",
#         "after": "3"
#     },
#     "pax": {
#         "ADT": 1,
#         "CHD": 0,
#         "INF": 0,
#         "UNN": 0
#     },
#     "redempoint": False,
#     "pointsBreakup": {
#         "option": "",
#         "value": 0
#     },
#     "isMultiCity": False,
#     "isDomestic": False
# }
# # proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
# proxy = 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:10730'
# # proxy = 'http://127.0.0.1:7890'
# session.proxies = {
#     'http': proxy,
#     'https': proxy,
# }
# # print(proxy)
#
# headers = {'Host': 'jbrest.jetblue.com', 'application-channel': 'Desktop_Web', 'sec-ch-ua-platform': '"macOS"', 'sec-ch-ua-mobile': '?0', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0', 'booking-application-type': 'NGB', 'content-type': 'application/json', 'accept': 'application/json', 'api-version': 'v3', 'origin': 'https://www.jetblue.com', 'sec-fetch-site': 'same-site', 'sec-fetch-mode': 'cors', 'sec-fetch-dest': 'empty', 'accept-language': 'en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7', 'x-1itxwo9i-f': 'AxvBzMmJAQAAaAQ7zgSP4nlKcZSttXsGb9uYkkLY7uLh100Yc-RKVcn629ZUAWe0HDyuchRAwH9eCOfvosJeCA==', 'x-1itxwo9i-b': 'uixy0h', 'x-1itxwo9i-c': 'AIDoycmJAQAAXTn26Pxf_1wI4-I5djOjN3T2MOw-0aPIA0D-voJsBMavdngQ', 'x-1itxwo9i-d': 'ABaAhIjBCKHFgQGAAYIQgISi0aIA5JmBzvp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8DA3cw45W2g9mO9O6OlfetLUlt90GEAg7JbpmKa1pgyKu1hM5ktq_6KzmJzrmrp4rsFA1b-foV7BFtBJjvWmRPnJeHGwAawvgPKhFhM2zp_p=p2WtB8y0hWFdPb2rJeHLd2kpyMtGPeuEypmu=GnNFJtSpnqHd3RxNFGd0mKfkF9uuUARjPmGCwB=UliB7DMr-=jwLiyNiqt9sl74D1XmoNShkD0LdzvuilzqekrY9M86DXfbDMAB2hPW8Lw3bd=sjdHioVXUaVXOd41eRa6cpgm5lQyHGmdcYct_J0eJRED8nXVNWqHDBH8luCDq5OYALToh64cGtWm_7QHYQhVy2UYrkccvXKaSEIvnlOyN0=H5G2ufUw3PBUKUBCOmxQb7_BaHVtpQ2fzlguGYd-2TLsl7OCLwG9k1fkMJSOdVe6m4_VrXd6VSLQ0JbYzVGcVm97tQuKAbIfi7c'}
#
#
# response = session.post(url, headers=headers, json=data)
#
# print(response.text)
import base64

from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5, PKCS1_OAEP

public_key = '-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+cSXdWRN7fovZBkzqcxIJNKQP1lytoU+wsLHXRZ6KDIYDl4H9M4DMtxnRrqsk52xw9lxIbe+P/vYeW2CoU7FB4iM4bvs+n48yqqUv6UkUB/BVH09sdX2ONkMQJmVqxMvaD2r7L7oxZ/POh1nstcGWufKTLYDuFce26vD9mVqikIC+7/lgnWZA5hbBlvtnzofJFbGqv1HBjCrlYsVBdU+okvJutys8EXlEm9Jc/WFoAM3bwIGOqKZwTMGYSBT7hoDxO7jazxh/EFEMPz9ofwf9ebJ5uk7sPVpk5pB2q5+pOmZMg/pRBFJidbZ4zy3ps6VlgN+4j5x/sc90cCNnNorkQIDAQAB\n-----END PUBLIC KEY-----'
plaintext = '4288160000079092'

rsakey = RSA.import_key(public_key)
cipher = PKCS1_OAEP.new(rsakey)
cipher_text = base64.b64encode(cipher.encrypt(plaintext.encode(encoding="utf-8")))
AccountNumberEncrypted = cipher_text.decode("utf-8")
print(len(AccountNumberEncrypted))
