登录
首页 » java » BBG的HIBE加密代码实现

BBG的HIBE加密代码实现

于 2023-03-08 发布 文件大小:11.92 kB
0 88
下载积分: 2 下载次数: 1

代码说明:

BBG的基于层次身份基的加密算法,利用JPBC库实现,可计算任意一层且层级无限制

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • Using java to write the Dove Chuanshu source code, java web application to learn...
    用java写的飞鸽传书源代码,学习java网络应用的经典-Using java to write the Dove Chuanshu source code, java web application to learn the classic
    2023-06-15 19:20:04下载
    积分:1
  • android 仿微信浏览相册图片例子源码下载
    [实例简介] 仿微信浏览相册图片, 相册浏览 [实例截图] [核心代码]import java.io.File;import java.io.FilenameFilter;import java.util.ArrayList;import java.util.Arrays;import java.util.HashSet;import java.util.List;import android.app.Activity;import android.app.ProgressDialog;import android.content.ContentResolver;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.os.Handler;import android.provider.MediaStore;import android.util.DisplayMetrics;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.View.OnClickListener;import android.view.ViewGroup.LayoutParams;import android.view.WindowManager;import android.widget.GridView;import android.widget.PopupWindow.OnDismissListener;import android.widget.RelativeLayout;import android.widget.TextView;import android.widget.Toast;import com.zhy.bean.ImageFloder;import com.zhy.imageloader.ListImageDirPopupWindow.OnImageDirSelected;public class MainActivity extends Activity implements OnImageDirSelected{ private ProgressDialog mProgressDialog; /** * 存储文件夹中的图片数量 */ private int mPicsSize; /** * 图片数量最多的文件夹 */ private File mImgDir; /** * 所有的图片 */ private List mImgs; private GridView mGirdView; private MyAdapter mAdapter; /** * 临时的辅助类,用于防止同一个文件夹的多次扫描 */ private HashSet mDirPaths = new HashSet(); /** * 扫描拿到所有的图片文件夹 */ private List mImageFloders = new ArrayList(); private RelativeLayout mBottomLy; private TextView mChooseDir; private TextView mImageCount; int totalCount = 0; private int mScreenHeight; private ListImageDirPopupWindow mListImageDirPopupWindow; private Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { mProgressDialog.dismiss(); // 为View绑定数据 data2View(); // 初始化展示文件夹的popupWindw initListDirPopupWindw(); } }; /** * 为View绑定数据 */ private void data2View() { if (mImgDir == null) { Toast.makeText(getApplicationContext(), "擦,一张图片没扫描到", Toast.LENGTH_SHORT).show(); return; } mImgs = Arrays.asList(mImgDir.list()); /** * 可以看到文件夹的路径和图片的路径分开保存,极大的减少了内存的消耗; */ mAdapter = new MyAdapter(getApplicationContext(), mImgs, R.layout.grid_item, mImgDir.getAbsolutePath()); mGirdView.setAdapter(mAdapter); mImageCount.setText(totalCount "张"); }; /** * 初始化展示文件夹的popupWindw */ private void initListDirPopupWindw() { mListImageDirPopupWindow = new ListImageDirPopupWindow( LayoutParams.MATCH_PARENT, (int) (mScreenHeight * 0.7), mImageFloders, LayoutInflater.from(getApplicationContext()) .inflate(R.layout.list_dir, null)); mListImageDirPopupWindow.setOnDismissListener(new OnDismissListener() { @Override public void onDismiss() { // 设置背景颜色变暗 WindowManager.LayoutParams lp = getWindow().getAttributes(); lp.alpha = 1.0f; getWindow().setAttributes(lp); } }); // 设置选择文件夹的回调 mListImageDirPopupWindow.setOnImageDirSelected(this); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); DisplayMetrics outMetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(outMetrics); mScreenHeight = outMetrics.heightPixels; initView(); getImages(); initEvent(); } /** * 利用ContentProvider扫描手机中的图片,此方法在运行在子线程中 完成图片的扫描,最终获得jpg最多的那个文件夹 */ private void getImages() { if (!Environment.getExternalStorageState().equals( Environment.MEDIA_MOUNTED)) { Toast.makeText(this, "暂无外部存储", Toast.LENGTH_SHORT).show(); return; } // 显示进度条 mProgressDialog = ProgressDialog.show(this, null, "正在加载..."); new Thread(new Runnable() { @Override public void run() { String firstImage = null; Uri mImageUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; ContentResolver mContentResolver = MainActivity.this .getContentResolver(); // 只查询jpeg和png的图片 Cursor mCursor = mContentResolver.query(mImageUri, null, MediaStore.Images.Media.MIME_TYPE "=? or " MediaStore.Images.Media.MIME_TYPE "=?", new String[] { "image/jpeg", "image/png" }, MediaStore.Images.Media.DATE_MODIFIED); Log.e("TAG", mCursor.getCount() ""); while (mCursor.moveToNext()) { // 获取图片的路径 String path = mCursor.getString(mCursor .getColumnIndex(MediaStore.Images.Media.DATA)); Log.e("TAG", path); // 拿到第一张图片的路径 if (firstImage == null) firstImage = path; // 获取该图片的父路径名 File parentFile = new File(path).getParentFile(); if (parentFile == null) continue; String dirPath = parentFile.getAbsolutePath(); ImageFloder imageFloder = null; // 利用一个HashSet防止多次扫描同一个文件夹(不加这个判断,图片多起来还是相当恐怖的~~) if (mDirPaths.contains(dirPath)) { continue; } else { mDirPaths.add(dirPath); // 初始化imageFloder imageFloder = new ImageFloder(); imageFloder.setDir(dirPath); imageFloder.setFirstImagePath(path); } int picSize = parentFile.list(new FilenameFilter() { @Override public boolean accept(File dir, String filename) { if (filename.endsWith(".jpg") || filename.endsWith(".png") || filename.endsWith(".jpeg")) return true; return false; } }).length; totalCount = picSize; imageFloder.setCount(picSize); mImageFloders.add(imageFloder); if (picSize > mPicsSize) { mPicsSize = picSize; mImgDir = parentFile; } } mCursor.close(); // 扫描完成,辅助的HashSet也就可以释放内存了 mDirPaths = null; // 通知Handler扫描图片完成 mHandler.sendEmptyMessage(0x110); } }).start(); } /** * 初始化View */ private void initView() { mGirdView = (GridView) findViewById(R.id.id_gridView); mChooseDir = (TextView) findViewById(R.id.id_choose_dir); mImageCount = (TextView) findViewById(R.id.id_total_count); mBottomLy = (RelativeLayout) findViewById(R.id.id_bottom_ly); } private void initEvent() { /** * 为底部的布局设置点击事件,弹出popupWindow */ mBottomLy.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mListImageDirPopupWindow .setAnimationStyle(R.style.anim_popup_dir); mListImageDirPopupWindow.showAsDropDown(mBottomLy, 0, 0); // 设置背景颜色变暗 WindowManager.LayoutParams lp = getWindow().getAttributes(); lp.alpha = .3f; getWindow().setAttributes(lp); } }); } @Override public void selected(ImageFloder floder) { mImgDir = new File(floder.getDir()); mImgs = Arrays.asList(mImgDir.list(new FilenameFilter() { @Override public boolean accept(File dir, String filename) { if (filename.endsWith(".jpg") || filename.endsWith(".png") || filename.endsWith(".jpeg")) return true; return false; } })); /** * 可以看到文件夹的路径和图片的路径分开保存,极大的减少了内存的消耗; */ mAdapter = new MyAdapter(getApplicationContext(), mImgs, R.layout.grid_item, mImgDir.getAbsolutePath()); mGirdView.setAdapter(mAdapter); // mAdapter.notifyDataSetChanged(); mImageCount.setText(floder.getCount() "张"); mChooseDir.setText(floder.getName()); mListImageDirPopupWindow.dismiss(); }}
    2015-04-08下载
    积分:1
  • java 实现 模拟 淘宝登录
    java+jsoup+httpclient 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
    2022-07-14 14:06:33下载
    积分:1
  • JAVA在线聊天系统
    利用java实现的在线聊天系统,基于客户端-服务器-客户端模式来实现聊天。
    2022-03-10 11:05:32下载
    积分:1
  • libgdx开发的飞船射击小游戏
    libgdx设计的android小游戏,内容为一个飞船在太空中飞行,躲避石块,并射击敌人。主要采用action来编写逻辑,对libgdx新手有很好的学习用处
    2022-02-25 09:12:57下载
    积分:1
  • ssm-master
    良好的可扩展性,ssh主流技术有强大的用户社区支持它,所以该框架扩展性非常强,针对特殊应用时具有良好的可插拔性,避免大部分因技术问题不能实现的功能。 3. 良好的可维护性,业务系统经常会有新需求,三层构架因为逻辑层和展现层的合理分离,可使需求修改的风险降低到最低。随着新技术的流行或系统的老化,系统可能需要重构,ssh构架重构成功率要比其他构架高很多(Good scalability, SSH mainstream technology has strong user community support, so the framework has strong scalability, and has good plug and play for special applications, avoiding most of the functions that can not be achieved due to technical problems. 3., good maintainability. Business systems often have new needs. The three tier architecture reduces the risk of demand modification to a minimum due to the reasonable separation of logic layer and presentation layer. With the popularity of new technology or the aging of the system, the system may need refactoring, and the success rate of SSH architecture reconfiguration is much higher than that of other architectures.)
    2018-03-12 09:08:42下载
    积分:1
  • Source-Code
    数据挖掘经典算法实现。使用这个算法分别对图片和DBLP上面学者的合作关系图进行了聚类,然后评估聚类的结果。算法实现用的java,DBLP的数据的搜集和预处理是用Python编写。(Classical data mining algorithm. Using this algorithm, respectively, pictures and cooperation between scholars DBLP above graph clustering, and then evaluate the results of clustering. Algorithm using java, DBLP data collection and pre-treatment is written in Python.)
    2013-10-17 04:38:27下载
    积分:1
  • 闹钟程序
    自醒着的时候定义了与这个先进的闹钟和用它来提醒和全天的计时器。慢慢增加卷中,轻轻地把你吵醒你早上闹钟。使用特大打盹按钮或解决数学问题,为了防止您无意中关闭警报。你甚至可以将暂停持续时间减少后每个打盹和设置小睡有什么的最大数目。闹钟加计时器功能包括: 音乐报警,随机歌曲报警,温柔报警量加大,数学贪睡、 驳回,摇动贪睡、 驳回,自动小睡,自动辞退,接下来的报警,计时器倒计时、 模拟时钟部件以及更多的时间。免费版功能全面但广告支持。让你在购买之前。升级到付费版本删除广告。现在结合秒表 Xtreme 解决所有你对时间的要求。
    2022-12-03 21:00:03下载
    积分:1
  • 泰格瑞德可靠性测试软件1.46(1)
    说明:  可靠性测试,确认数据通讯。 测试对应的ip,ip搜索,确认读写,tcp 串口等方式(Reliability test to confirm data communication. Test the corresponding ip, IP search, confirmation of read and write, TCP serial port, etc.)
    2020-06-20 04:40:01下载
    积分:1
  • 漂亮的时间选择器
    一款封装好的类似iphone的时间选择器
    2020-09-29 11:37:44下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载