java实现的LSB顺序隐写

上传者: 39452731 | 上传时间: 2021-03-22 10:12:30 | 文件大小: 33KB | 文件类型: ZIP
没有积分的私聊我 看到消息百分百发给你 1、算法核心: 1、读取图片A,获得其RGB三个通道数据并转换成三个矩阵a1,a2,a3。 2、读取文件B,将其转换成比特流b。 3、遍历b,得到比特b1,b2,b3,b4,b5,b6等等,将b1代替a1第一个元素的最低位,将b2代替a2第一个元素的最低位,将b3代替a3第一个元素的最低位,将b4代替a1第二个元素的最低位,以此类推。 2、具体实现: 1、隐写: 1、使用java ImageIO读取图片,获取其RGB通道信息。 2、使用java NIO读取被嵌入的文件,将其转换为byte数组,需要特别指出的是原生方法得到是byte类型的数组,但是算法实现需要更加精细的操作,所以还需要对得到的byte数组进行进一步的转换封装,将其转换成形如10101的数组。例如,读取文件得到byte数组的第一个元素为63,需将63转换为00111111数组。并且保存好文件的长度。 3、按照算法,遍历形如10101的数组 1、如果遍历到的值为0,将矩阵对应的矩阵元素与0xfe进行与运算,将最低位置为0 2、如果遍历到的值为1,将矩阵对应的矩阵元素与0x01进行或运算,将最低位置为1 4、将步骤3得到的经过经过隐写的矩阵写为一张新的图片。 3、读取 1、使用java ImageIO读取图片,获取其RGB通道信息。 2、使用隐写步骤3得到的文件长度,遍历图片的像素矩阵,需要特别指出的是因为后续步骤还需要进行进一步的转化,所以这一步是将得到的“100100......”序列每八位封装为一个数组,最终得到一些数组集合,每个数组包含八位二进制序列。 3、将步骤2得到的数组进行转换,例如00111111应该转换为byte类型数值为63的数字,10111111转换为-63。这一步会得到一个byte类型的数组。 4、将步骤3得到的byte类型数组写入文件,需要指出的是写入的文件形式应该和隐写模块步骤二中读入的文件形式一致。 3、程序使用方法 1、安装Java8 2、使用命令行进入jar文件所在目录下,使用命令 java -jar 2016115130.jar 3、安装提示输入嵌入和被嵌入的文件名字,注意路径问题

文件下载

资源详情

[{"title":"( 28 个子文件 33KB ) java实现的LSB顺序隐写","children":[{"title":"2016115130.iml <span style='color:#111;'> 81B </span>","children":null,"spread":false},{"title":"src","children":[{"title":"main","children":[{"title":"resources","children":null,"spread":false},{"title":"java","children":[{"title":"utils","children":[{"title":"Byte2BitArr.java <span style='color:#111;'> 1.61KB </span>","children":null,"spread":false},{"title":"ReadAndWriteFile.java <span style='color:#111;'> 1.55KB </span>","children":null,"spread":false}],"spread":true},{"title":"encrypt","children":[{"title":"Encrypt.java <span style='color:#111;'> 3.05KB </span>","children":null,"spread":false}],"spread":true},{"title":"decrypt","children":[{"title":"Decrypt.java <span style='color:#111;'> 2.57KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"test","children":[{"title":"java","children":[{"title":"GenTest.java <span style='color:#111;'> 266B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"pom.xml <span style='color:#111;'> 416B </span>","children":null,"spread":false},{"title":"target","children":[{"title":"classes","children":[{"title":"utils","children":[{"title":"Byte2BitArr.class <span style='color:#111;'> 1.15KB </span>","children":null,"spread":false}],"spread":true},{"title":"encrypt","children":[{"title":"Encrypt.class <span style='color:#111;'> 2.68KB </span>","children":null,"spread":false},{"title":"ReadAndWriteFile.class <span style='color:#111;'> 1.51KB </span>","children":null,"spread":false}],"spread":true},{"title":"decrypt","children":[{"title":"Decrypt.class <span style='color:#111;'> 1.79KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"generated-test-sources","children":[{"title":"test-annotations","children":null,"spread":false}],"spread":true},{"title":"maven-archiver","children":[{"title":"pom.properties <span style='color:#111;'> 109B </span>","children":null,"spread":false}],"spread":true},{"title":"surefire-reports","children":[{"title":"GenTest.txt <span style='color:#111;'> 255B </span>","children":null,"spread":false},{"title":"TEST-GenTest.xml <span style='color:#111;'> 5.22KB </span>","children":null,"spread":false}],"spread":true},{"title":"generated-sources","children":[{"title":"annotations","children":null,"spread":false}],"spread":true},{"title":"test-classes","children":[{"title":"GenTest.class <span style='color:#111;'> 683B </span>","children":null,"spread":false}],"spread":true},{"title":"open4j-1.0-SNAPSHOT.jar <span style='color:#111;'> 6.05KB </span>","children":null,"spread":false},{"title":"maven-status","children":[{"title":"maven-compiler-plugin","children":[{"title":"compile","children":[{"title":"default-compile","children":[{"title":"inputFiles.lst <span style='color:#111;'> 245B </span>","children":null,"spread":false},{"title":"createdFiles.lst <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"testCompile","children":[{"title":"default-testCompile","children":[{"title":"inputFiles.lst <span style='color:#111;'> 51B </span>","children":null,"spread":false},{"title":"createdFiles.lst <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":".idea","children":[{"title":"misc.xml <span style='color:#111;'> 530B </span>","children":null,"spread":false},{"title":"encodings.xml <span style='color:#111;'> 308B </span>","children":null,"spread":false},{"title":"libraries","children":[{"title":"opencv_330.xml <span style='color:#111;'> 335B </span>","children":null,"spread":false}],"spread":true},{"title":"workspace.xml <span style='color:#111;'> 40.71KB </span>","children":null,"spread":false},{"title":"uiDesigner.xml <span style='color:#111;'> 8.71KB </span>","children":null,"spread":false},{"title":"inspectionProfiles","children":[{"title":"Project_Default.xml <span style='color:#111;'> 1.41KB </span>","children":null,"spread":false}],"spread":true},{"title":"compiler.xml <span style='color:#111;'> 577B </span>","children":null,"spread":false},{"title":".name <span style='color:#111;'> 6B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明