• 大小: 7.54MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-22
  • 语言: Java
  • 标签: satrda  调用pbd  restful  

资源简介

SatRDA是目前最高效的远程数据访问组件,大数据量测试比外网直连数据库速度提升10-200倍。使用它无需要改动原来的数据连接访问代码就可以支持外网访问远程数据库。能够为android/ios等APP提供restful架构的数据接口。支持支付宝支付。部署非常简单,服务器客户端都无需安装,也无需安装iis,tomcat等其它软件。服务器端使用谷歌的golang开发支持10M级并发。

资源截图

代码片段和文件信息

package com.pcwe2002.satrda;

import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

import android.util.Log;

/*
01 算法/模式/填充                16字节加密后数据长度        不满16字节加密后长度
02 AES/CBC/NoPadding             16                          不支持
03 AES/CBC/PKCS5Padding          32                          16
04 AES/CBC/ISO10126Padding       32                          16
05 AES/CFB/NoPadding             16                          原始数据长度
06 AES/CFB/PKCS5Padding          32                          16
07 AES/CFB/ISO10126Padding       32                          16
08 AES/ECB/NoPadding             16                          不支持
09 AES/ECB/PKCS5Padding          32                          16
10 AES/ECB/ISO10126Padding       32                          16
11 AES/OFB/NoPadding             16                          原始数据长度
12 AES/OFB/PKCS5Padding          32                          16
13 AES/OFB/ISO10126Padding       32                          16
14 AES/PCBC/NoPadding            16                          不支持
15 AES/PCBC/PKCS5Padding         32                          16
16 AES/PCBC/ISO10126Padding      32                          16
 
 
 
CryptoJS supports the following padding schemes:
 
    Pkcs7 (the default)
    Iso97971
    AnsiX923
    Iso10126
    ZeroPadding
    NoPadding 
*/

public class Aes {
public static String TAG = “AES“;
/**
     * 加密
     *
     * @param content 需要加密的内容
     * @param key 加密密码
     * @param md5Key 是否对key进行md5加密
     * @param iv 加密向量
     * @return 加密后的字节数据
     */
    public static byte[] encrypt(byte[] content String key) {
        try {
         byte[] iv = key.getBytes();
            SecretKeySpec skeySpec = new SecretKeySpec(iv “AES“);
            Cipher cipher = Cipher.getInstance(“AES/OFB/NoPadding“); //“算法/模式/补码方式“
            IvParameterSpec ivps = new IvParameterSpec(iv);
            cipher.init(Cipher.ENCRYPT_MODE skeySpec ivps);
            return cipher.doFinal(content);
        } catch (Exception ex) {
            Log.d(TAG ex.toString());
        }
        return null;
    }
 
     
    public static byte[] decrypt(byte[] content String key) {
        try {
         byte[] iv = key.getBytes();
            SecretKeySpec skeySpec = new SecretKeySpec(iv “AES“);
            Cipher cipher = Cipher.getInstance(“AES/OFB/NoPadding“); //“算法/模式/补码方式“
            IvParameterSpec ivps = new IvParameterSpec(iv);
            cipher.init(Cipher.DECRYPT_MODE skeySpec ivps);
            return cipher.doFinal(content);
        } catch (Exception ex) {
            Log.d(TA

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        475  2016-06-02 11:06  SatRDA_Demo20161118\appdemo\satrda_forandroid\.classpath

     文件        842  2016-06-02 10:41  SatRDA_Demo20161118\appdemo\satrda_forandroid\.project

     文件        177  2016-06-02 10:41  SatRDA_Demo20161118\appdemo\satrda_forandroid\.settings\org.eclipse.jdt.core.prefs

     文件       1288  2016-06-12 16:43  SatRDA_Demo20161118\appdemo\satrda_forandroid\AndroidManifest.xml

     文件      51394  2016-06-02 10:41  SatRDA_Demo20161118\appdemo\satrda_forandroid\ic_launcher-web.png

     文件     621451  2016-06-02 10:41  SatRDA_Demo20161118\appdemo\satrda_forandroid\libs\android-support-v4.jar

     文件      26938  2014-01-09 10:58  SatRDA_Demo20161118\appdemo\satrda_forandroid\libs\httpmime-4.1.3.jar

     文件        781  2016-06-02 10:41  SatRDA_Demo20161118\appdemo\satrda_forandroid\proguard-project.txt

     文件        563  2016-06-12 16:27  SatRDA_Demo20161118\appdemo\satrda_forandroid\project.properties

     文件       7658  2016-06-02 10:41  SatRDA_Demo20161118\appdemo\satrda_forandroid\res\drawable-hdpi\ic_launcher.png

     文件       3777  2016-06-02 10:41  SatRDA_Demo20161118\appdemo\satrda_forandroid\res\drawable-mdpi\ic_launcher.png

     文件      12516  2016-06-02 10:41  SatRDA_Demo20161118\appdemo\satrda_forandroid\res\drawable-xhdpi\ic_launcher.png

     文件       2135  2016-06-16 14:23  SatRDA_Demo20161118\appdemo\satrda_forandroid\res\layout\activity_main.xml

     文件        220  2016-06-02 10:41  SatRDA_Demo20161118\appdemo\satrda_forandroid\res\values\dimens.xml

     文件        223  2016-06-02 10:41  SatRDA_Demo20161118\appdemo\satrda_forandroid\res\values\strings.xml

     文件        697  2016-06-02 10:41  SatRDA_Demo20161118\appdemo\satrda_forandroid\res\values\styles.xml

     文件       3249  2016-06-02 11:05  SatRDA_Demo20161118\appdemo\satrda_forandroid\src\com\pcwe2002\satrda\Aes.java

     文件       7197  2016-06-16 14:21  SatRDA_Demo20161118\appdemo\satrda_forandroid\src\com\pcwe2002\satrda\HttpUtil.java

     文件       5441  2016-06-16 14:21  SatRDA_Demo20161118\appdemo\satrda_forandroid\src\com\pcwe2002\satrda\MainActivity.java

     文件       1055  2016-06-12 13:44  SatRDA_Demo20161118\appdemo\satrda_forandroid\src\com\pcwe2002\satrda\ThreadUtil.java

     文件       1476  2016-06-12 17:14  SatRDA_Demo20161118\appdemo\satrda_forandroid\src\com\pcwe2002\satrda\Util.java

     文件       6148  2016-06-14 13:37  SatRDA_Demo20161118\appdemo\satrda_forios\satrda\.DS_Store

     文件       6148  2016-06-13 11:39  SatRDA_Demo20161118\appdemo\satrda_forios\satrda\satrda\.DS_Store

     文件      13195  2016-05-28 00:59  SatRDA_Demo20161118\appdemo\satrda_forios\satrda\satrda\AES.cpp

     文件       1603  2016-05-27 13:57  SatRDA_Demo20161118\appdemo\satrda_forios\satrda\satrda\AES.h

     文件       4562  2015-07-09 06:58  SatRDA_Demo20161118\appdemo\satrda_forios\satrda\satrda\AFNetworking\AFHTTPRequestOperation.h

     文件       7513  2015-07-09 06:58  SatRDA_Demo20161118\appdemo\satrda_forios\satrda\satrda\AFNetworking\AFHTTPRequestOperation.m

     文件      19967  2015-07-09 06:58  SatRDA_Demo20161118\appdemo\satrda_forios\satrda\satrda\AFNetworking\AFHTTPRequestOperationManager.h

     文件      11358  2015-07-09 06:58  SatRDA_Demo20161118\appdemo\satrda_forios\satrda\satrda\AFNetworking\AFHTTPRequestOperationManager.m

     文件      15261  2015-07-09 06:58  SatRDA_Demo20161118\appdemo\satrda_forios\satrda\satrda\AFNetworking\AFHTTPSessionManager.h

............此处省略376个文件信息

评论

共有 条评论