summaryrefslogtreecommitdiff
path: root/pipermail/pycrypto/2011q1/000403.html
blob: 04e45d372ec34e04f6558415188f124007aadc79 (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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> [pycrypto] Base64 encoded output differs from pycrypto and as3crypto libraries.
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=%5Bpycrypto%5D%20Base64%20encoded%20output%20differs%20from%20pycrypto%20and%0A%20as3crypto%20libraries.&In-Reply-To=3E0EA384-BCAA-40DC-BB39-E6EBE3CBE3F5%40gmail.com">
   <META NAME="robots" CONTENT="index,nofollow">
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <LINK REL="Previous"  HREF="000401.html">
   <LINK REL="Next"  HREF="000404.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[pycrypto] Base64 encoded output differs from pycrypto and as3crypto libraries.</H1>
    <B>Legrandin</B> 
    <A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=%5Bpycrypto%5D%20Base64%20encoded%20output%20differs%20from%20pycrypto%20and%0A%20as3crypto%20libraries.&In-Reply-To=3E0EA384-BCAA-40DC-BB39-E6EBE3CBE3F5%40gmail.com"
       TITLE="[pycrypto] Base64 encoded output differs from pycrypto and as3crypto libraries.">gooksankoo at hoiptorrow.mailexpire.com
       </A><BR>
    <I>Wed Jan 12 15:15:18 CST 2011</I>
    <P><UL>
        <LI>Previous message: <A HREF="000401.html">[pycrypto] Base64 encoded output differs from pycrypto and	as3crypto libraries.
</A></li>
        <LI>Next message: <A HREF="000404.html">[pycrypto] Base64 encoded output differs from pycrypto and as3crypto libraries.
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#403">[ date ]</a>
              <a href="thread.html#403">[ thread ]</a>
              <a href="subject.html#403">[ subject ]</a>
              <a href="author.html#403">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>&gt;<i>    var t_byAry:ByteArray = Hex.toArray( Hex.fromString( t_toEnc ) );
</I>&gt;<i>    var t_key:ByteArray = Hex.toArray( Hex.fromString( 'Thisisthekey' ) );
</I>&gt;<i>    var t_cbc:CBCMode = new CBCMode( new BlowFishKey( t_key ), new NullPad );
</I>&gt;<i>    t_cbc.IV = Hex.toArray( '30313233' );
</I>&gt;<i>    t_cbc.encrypt( t_byAry );
</I>&gt;<i>    t_enc = Base64.encodeByteArray( t_byAry );      
</I>
&gt;<i>    &gt;&gt;&gt; from Crypto.Cipher import Blowfish
</I>&gt;<i>    &gt;&gt;&gt; B = Blowfish.new( 'Thisisthekey', Blowfish.MODE_CBC, '30313233' )
</I>
Could it be that in you AS code your IV is 4 bytes (0x30,0x31,0x32,0x33)
which t_cbc.encrypt() silently pads, whereas in the python code it is 8
different bytes (0x33 for '3', 0x30 for '0', etc)?

Legrandin

</PRE>











<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="000401.html">[pycrypto] Base64 encoded output differs from pycrypto and	as3crypto libraries.
</A></li>
	<LI>Next message: <A HREF="000404.html">[pycrypto] Base64 encoded output differs from pycrypto and as3crypto libraries.
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#403">[ date ]</a>
              <a href="thread.html#403">[ thread ]</a>
              <a href="subject.html#403">[ subject ]</a>
              <a href="author.html#403">[ 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>