On Saturday, February 13, 2021 at 4:21:56 AM UTC+8, ssrin...@gmail.com wrote:
Hi,
I am having a ".TXT" file and I have generated SHA hash of ".TXT" file using Windows Command prompt like below
C:\temp>certutil -hashfile test.txt sha256I was created SHA3-512 using Java and run under pathway server:
SHA256 hash of test.txt: 7d967bad44f719f3733bbec0f1228f0247794096a434d57e6875f3367ead5f33
CertUtil: -hashfile command completed successfully. =============================================================
Now, If I upload the same ".TXT" file to Tandem . How to generate a SHA256 key so that I can compare the key generated from Tandem to the key which I already generated using Windows Command prompt (Certutil)
I am planning to use COBOL programming. Is there any routine which we can call from cobol ?
any help would be appreciated.
.properties
-----------------
# Type for algorithm
# sha3-224
# sha3-256
# sha3-384
# sha3-512
sha3.algorithm=sha3-512
sha3.uppercase=N
sha3.cutover=2200
sha3.trace=off ---------------------------------------------------------------------------------------
protected String calculateSHA3( String filename, EnscribeFile ef ) {Could anybody help on this ? i want to generate hash from file using SHA3-256 algorithm in vb.net, pls anybody help to get sample code or any idea on this.
I_Data iData = new I_Data();
Sha3 sha3 = null;
EnscribeOpenOptions opt = new EnscribeOpenOptions();
String result = null;
StringBuilder sb = new StringBuilder();
String lf = "";
String cr = "";
if (MyProperties.isTrace()) {
logger.info(String.format("Trace on: Filename: %s", filename));
}
switch (MyProperties.getAlgorithm().toUpperCase()) {
case "SHA3-224":
sha3 = new Sha3(Type.SHA3_224);
break;
case "SHA3-256":
sha3 = new Sha3(Type.SHA3_256);
break;
case "SHA3-384":
sha3 = new Sha3(Type.SHA3_384);
break;
case "SHA3-512":
sha3 = new Sha3(Type.SHA3_512);
break;
default:
sha3 = new Sha3(Type.SHA3_512);
break;
}
opt.setAccess(EnscribeOpenOptions.READ_ONLY); opt.setExclusion(EnscribeOpenOptions.SHARED);
try {
ef.open( opt );
if ( ef.getFileInfo().getFileType() != 0) {
if (MyProperties.isCrChar())
{
cr = "\r";
}
iData.set_bufferLen(ef.getFileInfo().getRecordLength());
lf = "\n";
}
else
{
/*
* For unstructured data, we need to use buffer as 1024 bytes to read the data
*/
opt.setUnstructuredAccess(true);
opt.setSequentialBlockBufferLength(1024);
}
int countread = 0;
do {
try {
countread = ef.read(iData);
if ( countread != -1 ) {
sb.append(iData.getSdata());
sb.append(cr).append(lf);
}
} catch (DataConversionException e) {
// TODO Auto-generated catch block
logger.log(Level.SEVERE, "Filename: " +
ef.getFileName() + ". " +
e.getLocalizedMessage(), e);
}
} while (countread != -1);
/*
* Compute SHA3
*/
result = HexTools.convertToHex(sha3.encode( sb.toString().getBytes(StandardCharsets.UTF_8)));
if (MyProperties.isUppercase())
{
result = result.toUpperCase();
}
else
{
result = result.toLowerCase();
}
} catch (EnscribeFileException e) {
// TODO Auto-generated catch block
logger.log(Level.SEVERE, "Filename: " +
ef.getFileName() + ". " +
e.getLocalizedMessage(), e);
} finally {
ef.close();
sb.setLength(0);
}
return result;
}
On Wednesday, February 24, 2021 at 10:59:44 AM UTC+5:30, s4n...@gmail.com wrote:
On Saturday, February 13, 2021 at 4:21:56 AM UTC+8, ssrin...@gmail.com wrote:
Hi,
I am having a ".TXT" file and I have generated SHA hash of ".TXT" file using Windows Command prompt like below
C:\temp>certutil -hashfile test.txt sha256I was created SHA3-512 using Java and run under pathway server:
SHA256 hash of test.txt: 7d967bad44f719f3733bbec0f1228f0247794096a434d57e6875f3367ead5f33 CertUtil: -hashfile command completed successfully. =============================================================
Now, If I upload the same ".TXT" file to Tandem . How to generate a SHA256 key so that I can compare the key generated from Tandem to the key which I already generated using Windows Command prompt (Certutil)
I am planning to use COBOL programming. Is there any routine which we can call from cobol ?
any help would be appreciated.
.properties
-----------------
# Type for algorithm
# sha3-224
# sha3-256
# sha3-384
# sha3-512
sha3.algorithm=sha3-512
sha3.uppercase=N
sha3.cutover=2200
sha3.trace=off ---------------------------------------------------------------------------------------
Googling this, you could potentially use https://github.com/brainhub/SHA3IUF or some other Open Source library, but that assumes your organization can take and use code from GitHub. Or develop your own SHA3 code - it is not that hard to do and well documented.protected String calculateSHA3( String filename, EnscribeFile ef ) {
I_Data iData = new I_Data();
Sha3 sha3 = null;
EnscribeOpenOptions opt = new EnscribeOpenOptions();
String result = null;
StringBuilder sb = new StringBuilder();
String lf = "";
String cr = "";
if (MyProperties.isTrace()) {
logger.info(String.format("Trace on: Filename: %s", filename));
}
switch (MyProperties.getAlgorithm().toUpperCase()) {
case "SHA3-224":
sha3 = new Sha3(Type.SHA3_224);
break;
case "SHA3-256":
sha3 = new Sha3(Type.SHA3_256);
break;
case "SHA3-384":
sha3 = new Sha3(Type.SHA3_384);
break;
case "SHA3-512":
sha3 = new Sha3(Type.SHA3_512);
break;
default:
sha3 = new Sha3(Type.SHA3_512);
break;
}
opt.setAccess(EnscribeOpenOptions.READ_ONLY); opt.setExclusion(EnscribeOpenOptions.SHARED);
try {
ef.open( opt );
if ( ef.getFileInfo().getFileType() != 0) {
if (MyProperties.isCrChar())
{
cr = "\r";
}
iData.set_bufferLen(ef.getFileInfo().getRecordLength());
lf = "\n";
}
else
{
/*
* For unstructured data, we need to use buffer as 1024 bytes to read the data
*/
opt.setUnstructuredAccess(true);
opt.setSequentialBlockBufferLength(1024);
}
int countread = 0;
do {
try {
countread = ef.read(iData);
if ( countread != -1 ) {
sb.append(iData.getSdata());
sb.append(cr).append(lf);
}
} catch (DataConversionException e) {
// TODO Auto-generated catch block
logger.log(Level.SEVERE, "Filename: " +
ef.getFileName() + ". " +
e.getLocalizedMessage(), e);
}
} while (countread != -1);
/*
* Compute SHA3
*/
result = HexTools.convertToHex(sha3.encode( sb.toString().getBytes(StandardCharsets.UTF_8)));
if (MyProperties.isUppercase())
{
result = result.toUpperCase();
}
else
{
result = result.toLowerCase();
}
} catch (EnscribeFileException e) {
// TODO Auto-generated catch block
logger.log(Level.SEVERE, "Filename: " +
ef.getFileName() + ". " +
e.getLocalizedMessage(), e);
} finally {
ef.close();
sb.setLength(0);
}
return result;
}Could anybody help on this ? i want to generate hash from file using SHA3-256 algorithm in vb.net, pls anybody help to get sample code or any idea on this.
On Wednesday, October 12, 2022 at 3:28:03 a.m. UTC-4, aravind...@gmail.com wrote:
On Wednesday, February 24, 2021 at 10:59:44 AM UTC+5:30, s4n...@gmail.com wrote:
On Saturday, February 13, 2021 at 4:21:56 AM UTC+8, ssrin...@gmail.com wrote:
Hi,
I am having a ".TXT" file and I have generated SHA hash of ".TXT" file using Windows Command prompt like below
C:\temp>certutil -hashfile test.txt sha256I was created SHA3-512 using Java and run under pathway server:
SHA256 hash of test.txt: 7d967bad44f719f3733bbec0f1228f0247794096a434d57e6875f3367ead5f33 CertUtil: -hashfile command completed successfully. =============================================================
Now, If I upload the same ".TXT" file to Tandem . How to generate a SHA256 key so that I can compare the key generated from Tandem to the key which I already generated using Windows Command prompt (Certutil)
I am planning to use COBOL programming. Is there any routine which we can call from cobol ?
any help would be appreciated.
.properties
-----------------
# Type for algorithm
# sha3-224
# sha3-256
# sha3-384
# sha3-512
sha3.algorithm=sha3-512
sha3.uppercase=N
sha3.cutover=2200
sha3.trace=off ---------------------------------------------------------------------------------------
I'm a bit interested in this topic due to the fact that we have a MD5 implementation which we need to replace. Haven't gotten to actually do it yet but when I did some research I found a very well structured library called Nettle which has the following punch line "Nettle is a low-level cryptographic library that is designed to fit easily in more or less any context.".protected String calculateSHA3( String filename, EnscribeFile ef ) {
I_Data iData = new I_Data();
Sha3 sha3 = null;
EnscribeOpenOptions opt = new EnscribeOpenOptions();
String result = null;
StringBuilder sb = new StringBuilder();
String lf = "";
String cr = "";
if (MyProperties.isTrace()) {
logger.info(String.format("Trace on: Filename: %s", filename));
}
switch (MyProperties.getAlgorithm().toUpperCase()) {
case "SHA3-224":
sha3 = new Sha3(Type.SHA3_224);
break;
case "SHA3-256":
sha3 = new Sha3(Type.SHA3_256);
break;
case "SHA3-384":
sha3 = new Sha3(Type.SHA3_384);
break;
case "SHA3-512":
sha3 = new Sha3(Type.SHA3_512);
break;
default:
sha3 = new Sha3(Type.SHA3_512);
break;
}
opt.setAccess(EnscribeOpenOptions.READ_ONLY); opt.setExclusion(EnscribeOpenOptions.SHARED);
try {
ef.open( opt );
if ( ef.getFileInfo().getFileType() != 0) {
if (MyProperties.isCrChar())
{
cr = "\r";
}
iData.set_bufferLen(ef.getFileInfo().getRecordLength());
lf = "\n";
}
else
{
/*
* For unstructured data, we need to use buffer as 1024 bytes to read the data
*/
opt.setUnstructuredAccess(true); opt.setSequentialBlockBufferLength(1024);
}
int countread = 0;
do {
try {
countread = ef.read(iData);
if ( countread != -1 ) {
sb.append(iData.getSdata());
sb.append(cr).append(lf);
}
} catch (DataConversionException e) {
// TODO Auto-generated catch block
logger.log(Level.SEVERE, "Filename: " +
ef.getFileName() + ". " +
e.getLocalizedMessage(), e);
}
} while (countread != -1);
/*
* Compute SHA3
*/
result = HexTools.convertToHex(sha3.encode( sb.toString().getBytes(StandardCharsets.UTF_8)));
if (MyProperties.isUppercase())
{
result = result.toUpperCase();
}
else
{
result = result.toLowerCase();
}
} catch (EnscribeFileException e) {
// TODO Auto-generated catch block
logger.log(Level.SEVERE, "Filename: " +
ef.getFileName() + ". " +
e.getLocalizedMessage(), e);
} finally {
ef.close();
sb.setLength(0);
}
return result;
Googling this, you could potentially use https://github.com/brainhub/SHA3IUF or some other Open Source library, but that assumes your organization can take and use code from GitHub. Or develop your own SHA3 code - it is not that hard to do and well documented.}Could anybody help on this ? i want to generate hash from file using SHA3-256 algorithm in vb.net, pls anybody help to get sample code or any idea on this.
On Wednesday, October 12, 2022 at 6:09:42 PM UTC+2, Randall wrote:
On Wednesday, October 12, 2022 at 3:28:03 a.m. UTC-4, aravind...@gmail.com wrote:
On Wednesday, February 24, 2021 at 10:59:44 AM UTC+5:30, s4n...@gmail.com wrote:
On Saturday, February 13, 2021 at 4:21:56 AM UTC+8, ssrin...@gmail.com wrote:
Hi,
I am having a ".TXT" file and I have generated SHA hash of ".TXT" file using Windows Command prompt like below
C:\temp>certutil -hashfile test.txt sha256I was created SHA3-512 using Java and run under pathway server:
SHA256 hash of test.txt: 7d967bad44f719f3733bbec0f1228f0247794096a434d57e6875f3367ead5f33 CertUtil: -hashfile command completed successfully. =============================================================
Now, If I upload the same ".TXT" file to Tandem . How to generate a SHA256 key so that I can compare the key generated from Tandem to the key which I already generated using Windows Command prompt (Certutil)
I am planning to use COBOL programming. Is there any routine which we can call from cobol ?
any help would be appreciated.
.properties
-----------------
# Type for algorithm
# sha3-224
# sha3-256
# sha3-384
# sha3-512
sha3.algorithm=sha3-512
sha3.uppercase=N
sha3.cutover=2200
sha3.trace=off ---------------------------------------------------------------------------------------
We implemented MD5, SHA1, SHA256 using the directions from NIST without other external assistance. The techniques are well described. It is not difficult to do if you know C. I cannot share our implementations as they are cryptographic and subject to export controls. Sharing cryptographic code is done at your own risk.protected String calculateSHA3( String filename, EnscribeFile ef ) {
I_Data iData = new I_Data();
Sha3 sha3 = null;
EnscribeOpenOptions opt = new EnscribeOpenOptions();
String result = null;
StringBuilder sb = new StringBuilder();
String lf = "";
String cr = "";
if (MyProperties.isTrace()) {
logger.info(String.format("Trace on: Filename: %s", filename));
}
switch (MyProperties.getAlgorithm().toUpperCase()) {
case "SHA3-224":
sha3 = new Sha3(Type.SHA3_224);
break;
case "SHA3-256":
sha3 = new Sha3(Type.SHA3_256);
break;
case "SHA3-384":
sha3 = new Sha3(Type.SHA3_384);
break;
case "SHA3-512":
sha3 = new Sha3(Type.SHA3_512);
break;
default:
sha3 = new Sha3(Type.SHA3_512);
break;
}
opt.setAccess(EnscribeOpenOptions.READ_ONLY); opt.setExclusion(EnscribeOpenOptions.SHARED);
try {
ef.open( opt );
if ( ef.getFileInfo().getFileType() != 0) {
if (MyProperties.isCrChar())
{
cr = "\r";
}
iData.set_bufferLen(ef.getFileInfo().getRecordLength());
lf = "\n";
}
else
{
/*
* For unstructured data, we need to use buffer as 1024 bytes to read the data
*/
opt.setUnstructuredAccess(true); opt.setSequentialBlockBufferLength(1024);
}
int countread = 0;
do {
try {
countread = ef.read(iData);
if ( countread != -1 ) {
sb.append(iData.getSdata());
sb.append(cr).append(lf);
}
} catch (DataConversionException e) {
// TODO Auto-generated catch block
logger.log(Level.SEVERE, "Filename: " +
ef.getFileName() + ". " +
e.getLocalizedMessage(), e);
}
} while (countread != -1);
/*
* Compute SHA3
*/
result = HexTools.convertToHex(sha3.encode( sb.toString().getBytes(StandardCharsets.UTF_8)));
if (MyProperties.isUppercase())
{
result = result.toUpperCase();
}
else
{
result = result.toLowerCase();
}
} catch (EnscribeFileException e) {
// TODO Auto-generated catch block
logger.log(Level.SEVERE, "Filename: " +
ef.getFileName() + ". " +
e.getLocalizedMessage(), e);
} finally {
ef.close();
sb.setLength(0);
}
return result;
I'm a bit interested in this topic due to the fact that we have a MD5 implementation which we need to replace. Haven't gotten to actually do it yet but when I did some research I found a very well structured library called Nettle which has the following punch line "Nettle is a low-level cryptographic library that is designed to fit easily in more or less any context.".Googling this, you could potentially use https://github.com/brainhub/SHA3IUF or some other Open Source library, but that assumes your organization can take and use code from GitHub. Or develop your own SHA3 code - it is not that hard to do and well documented.}Could anybody help on this ? i want to generate hash from file using SHA3-256 algorithm in vb.net, pls anybody help to get sample code or any idea on this.
You'll find it here: https://git.lysator.liu.se/nettle/nettle
Please report back if you're successful and tell us how you solved it!
There is another aspect to the question of calculating a hash on a text file. The definition of a text file is specific to the operating system it resides on. When you transfer a text file, the End of Line indicator may be translated, tabs may be translated to spaces, trailing spaces may be truncated, etc. If you transfer it as a text file instead of a binary file, they likely wonrCOt be a bit for bit match.Hi Jon,
Jon Marcus
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 03:51:21 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
683 files (6,829M bytes) |
| Messages: | 264,528 |