27寸显示器哪款好1200价位的买哪个好

资料评价:
所需积分:0J2ME加密的问题
10whoareu]
J2ME加密的问题
10whoareu]
发布时间: 11:55:23
编辑:www.fx114.net
本篇文章主要介绍了"J2ME加密的问题
10whoareu]",主要涉及到J2ME加密的问题
10whoareu]方面的内容,对于J2ME加密的问题
10whoareu]感兴趣的同学可以参考一下。
导入import&org.bouncycastle.crypto.*包后出现下面提示:
Error&preverifying&class&org.bouncycastle.asn1.DERInputStream
&&&&java/lang/NoClassDefFoundError:&java/io/FilterInputStream
com.sun.kvem.ktools.ExecutionException:&Preverifier&returned&1
请问如何解决啊?请问你用什么开发工具的???WTK?是啊。怎么解决啊?你要加的这个类是为j2me写的吗?
要不是的话
预编译的时候就会报错了!
可能使操作了什么j2me里不允许操作的方法,
或是什么东西会导致错误什么的!奇怪,我也遇到了这个问题,我的是在连接网络的时候遇到的
在jcreator里面编译,用了motorola388sdkJ2ME的java.io包中没有java.io.FilterInputStream,所以报java/lang/NoClassDefFoundError:&java/io/FilterInputStream
可以等org.bouncycastle出了新的针对J2ME的版本,或者自己把org.bouncycastle的代码改改如果工作量不大的话。FilterInputStream这个类不存在不要用motosdk,那有许多问题,直接用jb+mb,打包用wtk
一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!
二、互相尊重,对自己的言论和行为负责。
本文标题:
本页链接:网站已改版,请使用新地址访问:
j2meautoLogin 实现手机客户端自动登录的一个简单程序,
238万源代码下载-
&文件名称: j2meautoLogin
& & & & &&]
&&所属分类:
&&开发工具: Java
&&文件大小: 366 KB
&&上传时间:
&&下载次数: 8
&&提 供 者:
&详细说明:j2me实现手机客户端自动登录的一个简单程序,-j2me auto login
文件列表(点击判断是否您需要的文件,如果是垃圾请在下面评价投诉):
&&源码网说明.txt&&bin\org\bouncycastle\crypto\digests\package.html&&src\org\bouncycastle\crypto\digests\package.html&&bin\org\bouncycastle\crypto\package.html&&src\org\bouncycastle\crypto\package.html&&bin\org\bouncycastle\crypto\prng\package.html&&src\org\bouncycastle\crypto\prng\package.html&&bin\org\bouncycastle\util\encoders\package.html&&src\org\bouncycastle\util\encoders\package.html&&下载说明.html&&bin\org\kxml\parser\AbstractXmlParser.class&&.eclipseme.tmp\verified\classes\org\kxml\parser\AbstractXmlParser.class&&bin\org\kxml\io\AbstractXmlWriter.class&&.eclipseme.tmp\verified\classes\org\kxml\io\AbstractXmlWriter.class&&bin\Account.class&&.eclipseme.tmp\verified\classes\Account.class&&..............\........\.......\org\bouncycastle\crypto\AsymmetricBlockCipher.class&&bin\org\bouncycastle\crypto\AsymmetricBlockCipher.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\AsymmetricCipherKeyPair.class&&bin\org\bouncycastle\crypto\AsymmetricCipherKeyPair.class&&...\...\kxml\Attribute.class&&.eclipseme.tmp\verified\classes\org\kxml\Attribute.class&&bin\org\bouncycastle\util\encoders\Base64.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\util\encoders\Base64.class&&bin\org\bouncycastle\util\encoders\Base64Encoder.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\util\encoders\Base64Encoder.class&&..............\........\.......\...\............\crypto\BlockCipher.class&&bin\org\bouncycastle\crypto\BlockCipher.class&&...\...\............\......\BufferedAsymmetricBlockCipher.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\BufferedAsymmetricBlockCipher.class&&bin\org\bouncycastle\crypto\BufferedBlockCipher.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\BufferedBlockCipher.class&&bin\org\bouncycastle\util\encoders\BufferedDecoder.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\util\encoders\BufferedDecoder.class&&bin\org\bouncycastle\util\encoders\BufferedEncoder.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\util\encoders\BufferedEncoder.class&&..............\........\.......\...\............\crypto\CipherParameters.class&&bin\org\bouncycastle\crypto\CipherParameters.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\CryptoException.class&&bin\org\bouncycastle\crypto\CryptoException.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\DataLengthException.class&&bin\org\bouncycastle\crypto\DataLengthException.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\DerivationFunction.class&&bin\org\bouncycastle\crypto\DerivationFunction.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\DerivationParameters.class&&bin\org\bouncycastle\crypto\DerivationParameters.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\Digest.class&&bin\org\bouncycastle\crypto\Digest.class&&...\...\............\......\prng\DigestRandomGenerator.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\prng\DigestRandomGenerator.class&&bin\org\kxml\kdom\Document.class&&.eclipseme.tmp\verified\classes\org\kxml\kdom\Document.class&&bin\MIDlets\DSASigTest.class&&.eclipseme.tmp\verified\classes\MIDlets\DSASigTest.class&&bin\MIDlets\ECDSASigTest.class&&.eclipseme.tmp\verified\classes\MIDlets\ECDSASigTest.class&&bin\org\kxml\kdom\Element.class&&.eclipseme.tmp\verified\classes\org\kxml\kdom\Element.class&&..............\........\.......\...\bouncycastle\util\encoders\Encoder.class&&bin\org\bouncycastle\util\encoders\Encoder.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\ExtendedDigest.class&&bin\org\bouncycastle\crypto\ExtendedDigest.class&&...\...\............\......\digests\GeneralDigest.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\digests\GeneralDigest.class&&bin\org\bouncycastle\util\encoders\Hex.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\util\encoders\Hex.class&&bin\HexCodec.class&&.eclipseme.tmp\verified\classes\HexCodec.class&&bin\org\bouncycastle\util\encoders\HexEncoder.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\util\encoders\HexEncoder.class&&bin\org\bouncycastle\util\encoders\HexTranslator.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\util\encoders\HexTranslator.class&&..............\........\.......\...\............\crypto\InvalidCipherTextException.class&&bin\org\bouncycastle\crypto\InvalidCipherTextException.class&&...\LoginMIDlet.class&&.eclipseme.tmp\verified\classes\LoginMIDlet.class&&bin\org\bouncycastle\crypto\digests\LongDigest.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\digests\LongDigest.class&&..............\........\.......\...\............\......\Mac.class&&bin\org\bouncycastle\crypto\Mac.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\MaxBytesExceededException.class&&bin\org\bouncycastle\crypto\MaxBytesExceededException.class&&...\...\............\......\digests\MD2Digest.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\digests\MD2Digest.class&&bin\org\bouncycastle\crypto\digests\MD4Digest.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\digests\MD4Digest.class&&bin\MD5.class&&.eclipseme.tmp\verified\classes\MD5.class&&bin\org\bouncycastle\crypto\digests\MD5Digest.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\digests\MD5Digest.class&&bin\org\kxml\kdom\Node.class&&.eclipseme.tmp\verified\classes\org\kxml\kdom\Node.class&&bin\org\kxml\parser\ParseEvent.class&&.eclipseme.tmp\verified\classes\org\kxml\parser\ParseEvent.class&&bin\org\kxml\io\ParseException.class&&.eclipseme.tmp\verified\classes\org\kxml\io\ParseException.class&&bin\PasswordMIDlet.class&&.eclipseme.tmp\verified\classes\PasswordMIDlet.class&&bin\org\bouncycastle\crypto\PBEParametersGenerator.class&&.eclipseme.tmp\verified\classes\org\bouncycastle\crypto\PBEParametersGenerator.class
&相关搜索:
&输入关键字,在本站238万海量源码库中尽情搜索:
&[] - 简单手机考试系统的开发,从题库中随机抽题考试,已经经过测试,可以运行!J2ME(Java 2 Micro Edition)
共有626位成员   人气指数 -   最新排名 -
【话题】有人用BouncyCastle在J2ME上解决过ECDSA加密的问题么
22:29:10 来自:happyone 浏览数:11次
有人用BouncyCastle在J2ME上解决过ECDSA加密的问题么
Tom仕回复于10日22点36分 
=============
11月6日,论坛升级公告,积分已经做了调整!
http://topic.csdn.net/u//b27dc75f-14b1--5b18d9e36a11.html
此次调整增加了两个新的可用分获取渠道:
1:帖子被推荐(加精)后,帖主可以获得88分的可用分奖励;
2:帖子结帖后会返还帖主50%的悬赏分,无满意结帖不返还分数;
3:接下来会不断增加新的可用分获取途径,比如参与活动赠送等,请大家多关注;
不管怎样要建设回复于10日22点44分 
tai man bu shiyong
J2ME(Java 2 Micro Edition)的其他话题...
热门脚本语言:2009人阅读
J2ME(12)
Bouncy Castle Crypto APIs 是一个开源的轻量级Java 加密解密包,实现了JCE/JCA的provider,支持AES等多种加密解密算法。
详情请见主页:http://www.bouncycastle.org/java.html
本文的示例代码使用了http://www.bouncycastle.org/download/bcprov-jdk16-139.jar
1)使用JCE的AES-128-CBC加密解密(j2se)
package com.albertsong.
import java.security.K
import java.security.S
import javax.crypto.C
import javax.crypto.spec.IvParameterS
import javax.crypto.spec.SecretKeyS
import org.bouncycastle.jce.provider.BouncyCastleP
import org.bouncycastle.util.encoders.H
public class AESWithJCE {
* @param args
public static void main(String[] args) {
byte[] keybytes = { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38 };
byte[] iv = { 0x38, 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x38,
0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31 };
String content =&TESTABCDEFGHIJKLMNOPQRSTUVWXYZ&;
System.out.println(&Original content:&);
System.out.println(content);
Security.addProvider(new BouncyCastleProvider());
Key key = new SecretKeySpec(keybytes, &AES&);
Cipher in = Cipher.getInstance(&AES/CBC/PKCS7Padding&,&BC&);
in.init(Cipher.ENCRYPT_MODE, key, new IvParameterSpec(iv));
byte[] enc = in.doFinal(content.getBytes());
System.out.println(&Encrypted Content:&);
System.out.println(new String(Hex.encode(enc)));
Cipher out = Cipher.getInstance(&AES/CBC/PKCS7Padding&, &BC&);
out.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(iv));
byte[] dec = out.doFinal(enc);
System.out.println(&Decrypted Content:&);
System.out.println(new String(dec));
} catch (Exception ex) {
ex.printStackTrace();
2)不使用JCE的AES-128-CBC加密解密,可以用于J2ME程序中。
package com.albertsong.
import org.bouncycastle.crypto.BufferedBlockC
import org.bouncycastle.crypto.engines.AESFastE
import org.bouncycastle.crypto.modes.CBCBlockC
import org.bouncycastle.crypto.paddings.PaddedBufferedBlockC
import org.bouncycastle.crypto.params.KeyP
import org.bouncycastle.crypto.params.ParametersWithIV;
import org.bouncycastle.util.encoders.H
* @author Albert
* @version 1.0
public class AESWithoutJCE {
* @param args
public static void main(String[] args) {
byte[] keybytes = { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38 };
byte[] iv = { 0x38, 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x38,
0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31 };
String content =&TESTABCDEFGHIJKLMNOPQRSTUVWXYZ&;
System.out.println(&Original content:&);
System.out.println(content);
BufferedBlockCipher engine = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESFastEngine()));
engine.init(true, new ParametersWithIV(new KeyParameter(keybytes),iv));
byte[] enc = new byte[engine.getOutputSize(content.getBytes().length)];
int size1 = engine.processBytes(content.getBytes(), 0, content.getBytes().length, enc, 0);
int size2 = engine.doFinal(enc, size1);
System.out.println(&size2 =&+size2);
byte[] encryptedContent =new byte[size1+size2];
System.arraycopy(enc, 0, encryptedContent, 0, encryptedContent.length);
System.out.println(&Encrypted Content:&);
System.out.println(new String(Hex.encode(encryptedContent)));
engine.init(false, new ParametersWithIV(new KeyParameter(keybytes),iv));
byte[] dec = new byte[engine.getOutputSize(encryptedContent.length)];
size1 = engine.processBytes(encryptedContent, 0, encryptedContent.length, dec, 0);
size2 = engine.doFinal(dec, size1);
System.out.println(&size2 =&+size2);
byte[] decryptedContent =new byte[size1+size2];
System.arraycopy(dec, 0, decryptedContent, 0, decryptedContent.length);
System.out.println(&Decrypted Content:&);
System.out.println(new String(decryptedContent));
} catch (Exception ex) {
ex.printStackTrace();
3.用作一个工具类,传入明文或密码分别实现加密解密
package com.albertsong.
import org.bouncycastle.crypto.BufferedBlockC
import org.bouncycastle.crypto.engines.AESFastE
import org.bouncycastle.crypto.modes.CBCBlockC
import org.bouncycastle.crypto.paddings.PaddedBufferedBlockC
import org.bouncycastle.crypto.params.KeyP
import org.bouncycastle.crypto.params.ParametersWithIV;
import org.bouncycastle.util.encoders.H
public class AES_128_CBC {
static byte[] keybytes = { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38 };
static byte[] iv = { 0x38, 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x38,
0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31 };
* @param content 需要加密的内容
* @return 密文
* @throws Exception
public static String Encrypt(String content) throws Exception{
BufferedBlockCipher engine = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESFastEngine()));
engine.init(true, new ParametersWithIV(new KeyParameter(keybytes),iv));
byte[] enc = new byte[engine.getOutputSize(content.getBytes().length)];
int size1 = engine.processBytes(content.getBytes(), 0, content.getBytes().length, enc, 0);
int size2 = engine.doFinal(enc, size1);
System.out.println(&size2 =&+size2);
byte[] encryptedContent =new byte[size1+size2];
System.arraycopy(enc, 0, encryptedContent, 0, encryptedContent.length);
System.out.println(&Encrypted Content:&);
String key = new String(Hex.encode(encryptedContent));
System.out.println(key);
* @param Key 密文
* @return 明文
* @throws Exception
public static String Decrypt(String Key) throws Exception {
byte[] encryptedContent = hex2byte(Key);
BufferedBlockCipher engine = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESFastEngine()));
engine.init(false, new ParametersWithIV(new KeyParameter(keybytes),iv));
byte[] dec = new byte[engine.getOutputSize(encryptedContent.length)];
int size1 = engine.processBytes(encryptedContent, 0, encryptedContent.length, dec, 0);
int size2 = engine.doFinal(dec, size1);
System.out.println(&size2 =&+size2);
byte[] decryptedContent =new byte[size1+size2];
System.arraycopy(dec, 0, decryptedContent, 0, decryptedContent.length);
System.out.println(&Decrypted Content:&);
System.out.println(new String(decryptedContent));
String content = new String(new String(decryptedContent));
public static byte[] hex2byte(String strhex) {
if (strhex == null) {
int l = strhex.length();
if (l % 2 == 1) {
byte[] b = new byte[l / 2];
for (int i = 0; i != l / 2; i++) {
b[i] = (byte) Integer.parseInt(strhex.substring(i * 2, i * 2 + 2),
public static String byte2hex(byte[] b) {
String hs = &&;
String stmp = &&;
for (int n = 0; n & b. n++) {
stmp = (java.lang.Integer.toHexString(b[n] & 0XFF));
if (stmp.length() == 1) {
hs = hs + &0& +
return hs.toUpperCase();
public static void main(String[] args) {
String content =&偶像Jordan&;
String content = &KaRant is The Best !!&;
System.out.println(&Original content:&);
System.out.println(content);
String enc =
enc = Encrypt(content);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
new String(Decrypt(enc));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:141022次
排名:千里之外
转载:13篇
评论:27条
(1)(3)(1)(4)(5)(9)(15)(6)(3)(18)(10)(5)(1)

我要回帖

更多关于 32寸还是27寸显示器好 的文章

 

随机推荐