小编Twi*_*ter的帖子

Android:具有异步任务的JSON解析器(GET和POST方法)

只是想检查这个具有异步任务的JSON Parser是否正确完成了?当我把这个代码放到我的Eclipse中时,这个(method.equals("POST")下划线为红色.并且它声明'方法'无法解决.有什么建议或帮助吗?谢谢.

public class JSONParser {

  static InputStream is = null;
  static JSONObject jObj = null;
  static String json = "";
  String url=null;
     List<NameValuePair> nvp=null;
     // constructor
     public JSONParser() {

   }

  // function get json from url
  // by making HTTP POST or GET method
   public JSONObject makeHttpRequest(String url, String method,
        List<NameValuePair> params) {
      BackGroundTask Task= new BackGroundTask(url, method,  params);
    try {
        return Task.execute().get();
    } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        return null;
    } catch (ExecutionException …
Run Code Online (Sandbox Code Playgroud)

java android

4
推荐指数
1
解决办法
2万
查看次数

将图像(png)转换为字符串然后加密图像

我想加密图像然后解密它.是否有任何好的参考或教程或示例显示如何将图像转换为字符串然后加密字符串?或者还有其他加密图像的方法?因为我是这个的新手,而且我去搜索,但没有任何简单的例子供我理解和遵循.

如果我没错,我必须使用FileInputstream和ImageIO,但我不知道它是如何完全工作的.有人可以指导我吗?谢谢

java encryption image

3
推荐指数
1
解决办法
1353
查看次数

图像文件的加密和解密

结合我的另一个问题,并在更改了这部分代码之后

FileOutputStream output = new FileOutputStream("sheepTest.png");
    CipherOutputStream cos = new CipherOutputStream(output, pbeCipher);
    ImageIO.write(input, "PNG", cos);
    cos.close();
Run Code Online (Sandbox Code Playgroud)

从解密部分,我遇到了另一个错误,就是这个

Exception in thread "main" java.lang.IllegalArgumentException: image == null!
at javax.imageio.ImageTypeSpecifier.createFromRenderedImage(Unknown Source)
at javax.imageio.ImageIO.getWriter(Unknown Source)
at javax.imageio.ImageIO.write(Unknown Source)
at encypt.com.trial.main(trial.java:82)
Run Code Online (Sandbox Code Playgroud)

当我点击sheepTest.png时,文件为空.错误在哪里?任何人都可以帮我解决错误吗?谢谢.

public class trial {
public static void main(String[] arg) throws Exception {

   // Scanner to read the user's password. The Java cryptography
   // architecture points out that strong passwords in strings is a
   // bad idea, but we'll let it go …
Run Code Online (Sandbox Code Playgroud)

java encryption image aes

0
推荐指数
1
解决办法
1万
查看次数

哪种哈希算法用于密码PHP

可能重复:
PHP密码的安全散列和盐

为了加密php文件中的密码,我想更改为sha256md5,而不是使用sha1作为iIwent进行在线研究,他们说sha1不是那么安全.

如何更改php文件?

<?php

class DB_Functions {

private $db;

//put your code here
// constructor
function __construct() {
    require_once 'DB_Connect.php';
    // connecting to database
    $this->db = new DB_Connect();
    $this->db->connect();
}

// destructor
function __destruct() {

}

/**
 * Storing new user
 * returns user details
 */
public function storeUser($name, $nric, $email, $license, $address, $postal_code, $password) {
    $hash = $this->hashSSHA($password);
    $encrypted_password = $hash["encrypted"]; // encrypted password
    $salt = …
Run Code Online (Sandbox Code Playgroud)

php encryption passwords

0
推荐指数
1
解决办法
3193
查看次数

标签 统计

encryption ×3

java ×3

image ×2

aes ×1

android ×1

passwords ×1

php ×1