Laravel和节点js加密

时间:2017-02-25 17:53:53

标签: javascript php node.js laravel encryption

更新

 <LinearLayout
        android:paddingTop="20dp"
        android:layout_gravity="center"
        android:weightSum="2"
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <Button
            android:id="@+id/btn_male"
            android:textColor="@color/White"
            android:background="@color/colorPrimaryDark"
            android:layout_gravity="end"
            android:text="@string/male"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="genderPerson"
            />

        <Button
            android:id="@+id/btn_female"
            android:textColor="@color/White"
            android:background="@color/colorPrimaryDark"
            android:text="@string/female"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="genderPerson"
            />
    </LinearLayout>

所以我使用上面的代码。现在的问题是输出显示了其他字符。

var key = new Buffer('laravel app ', 'base64');
var json =  JSON.parse(new Buffer(password_encrypted,'base64').toString('utf8'));
var _iv =   new Buffer(json.iv , 'base64');
var decipher  = crypto.createDecipheriv('AES-256-CBC', key, _iv);
decipher.setAutoPadding(false);
var t = new Buffer(json.value,'base64');
var dec = decipher.update(t) + decipher.final();
console.log(dec);

我只想提取密码,也许我在crypto中缺少一些设置?

0 个答案:

没有答案