summaryrefslogtreecommitdiff
path: root/pipermail/pycrypto/2011q4/000479.html
blob: bcabc7a5dfb629930ecfd1f51e27d9f718b3d98a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> [pycrypto] string XOR
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=%5Bpycrypto%5D%20string%20XOR&In-Reply-To=8129C8D99AA86D4A9A8BEA3E7DCC806A36B9AECCC9%40exch-mail.bridge.net">
   <META NAME="robots" CONTENT="index,nofollow">
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <LINK REL="Previous"  HREF="000489.html">
   <LINK REL="Next"  HREF="000480.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[pycrypto] string XOR</H1>
    <B>Paul_Koning at Dell.com</B> 
    <A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=%5Bpycrypto%5D%20string%20XOR&In-Reply-To=8129C8D99AA86D4A9A8BEA3E7DCC806A36B9AECCC9%40exch-mail.bridge.net"
       TITLE="[pycrypto] string XOR">Paul_Koning at Dell.com
       </A><BR>
    <I>Fri Oct 21 10:06:13 CST 2011</I>
    <P><UL>
        <LI>Previous message: <A HREF="000489.html">[pycrypto] string XOR
</A></li>
        <LI>Next message: <A HREF="000480.html">[pycrypto] ANN: PyCrypto 2.4 released
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#479">[ date ]</a>
              <a href="thread.html#479">[ thread ]</a>
              <a href="subject.html#479">[ subject ]</a>
              <a href="author.html#479">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>&quot;&quot;.join([chr (ord(a)^ord(b)) for a,b in zip(&quot;abc&quot;,&quot;def&quot;)])

                paul

From: <A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">pycrypto-bounces at lists.dlitz.net</A> [mailto:<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">pycrypto-bounces at lists.dlitz.net</A>] On Behalf Of Dean Macinskas
Sent: Friday, October 21, 2011 9:56 AM
To: <A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">pycrypto at lists.dlitz.net</A>
Subject: [pycrypto] string XOR

This isn't a pycrypto question per se, but I thought someone might know the answer: I need to exclusive-OR two strings together.  I tried operator.XOR, but I get a runtime error:

    ke = operator.xor(kbpkb,ve)
TypeError: unsupported operand type(s) for ^: 'str' and 'str'

Is there a way to do this in native Python (I'm using 2.7.2), or must I use a library of some sort?

Thanks,
dpm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <A HREF="http://lists.dlitz.net/pipermail/pycrypto/attachments/20111021/19554354/attachment.htm">http://lists.dlitz.net/pipermail/pycrypto/attachments/20111021/19554354/attachment.htm</A> 
</PRE>









<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="000489.html">[pycrypto] string XOR
</A></li>
	<LI>Next message: <A HREF="000480.html">[pycrypto] ANN: PyCrypto 2.4 released
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#479">[ date ]</a>
              <a href="thread.html#479">[ thread ]</a>
              <a href="subject.html#479">[ subject ]</a>
              <a href="author.html#479">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">More information about the pycrypto
mailing list</a><br>
</body></html>