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rypt(t *testing.T) {
	plaintext := "mini-chat"
	t.Log(PublicKeyEncrypt(publicKey, plaintext))
}

func TestPrivateKeyDecrypt(t *testing.T) {
	ciphertext := "bpPQp-PI-9HFjtro8Iowv7RNhY1todIhmjFkmmwjIana5RIp6ZkfkjN7_auZp_5Xo9htF_1kJ7L4cE4ixDT8l0R4u3ZGvfYJ3lP7d-De7rk_vvrEdetGEh-VGAhp3iHRgypV8CErt0JNCXcCEM_Bk87K5FLThFoU997c9IYdS6vO1WGcLsd_qzqWGxolNrSJt_oWrX4BEwu8PtVomSHbV7oG3XBRFcitzx6Ye9SjFrouUks5snzj9_2FqLoNE6dRRBPvyR0Iz753dE3CqgxUDjBhQftXPufx6r5XU1EJ4DcZDk6ZRAplOo_bgqTa91cfKhddIfdyg9nxcovmoxxyKg=="
	t.Log(PrivateKeyDecrypt(privateKey, ciphertext))
}
