Using MAC address for encryption - pgp

I want to write a program that works only on computers with approved Mac addresses.
I need 2 programs, program 1 takes the MAC address and pass phrase as input and generates a password.
Program 2 takes the password compares it with MAC address and generates the passphrase.
how would this be done?

If you use the MAC address as the salt for a hash of the pass phrase, you should be able to compare the result against a list of known hashes. That would seem to meet your needs. Do you need more help than this or are those terms you understand (or can google)?

Related

A communication system for my encryption/decryption algo

Actually I'm working on some encryption/decryption algorithm. I have hard coded it in python and I want to experiment it. So what is the best way to establish a text communication in windows. Like communication between two virtual eniviroment or something. If my question is not clear please let me know. I can say simply that i want to test my encryption/decryption algorithm through a plain text chat medium with minimum two users.
I ran my code in my system and code in working prefectly here. Like if we give input as plain text you will get output as encrypted output and decrypted output. I want to try same code with in two users chat encryption/decryption lively.

How can NodeJS keyboard text input go directly into a Buffer instead of a string?

I have been designing a system with some super careful cryptographic needs and decided that having the console app administrator type in a sensitive cryptographic password when the app calls for it might be the way to go in my use case.
I was reading that we do not want to store this password (cryptographic key) as a string because it remains immutable in memory and could be found by an attacker via a memory dump. I read that such keys should be a Buffer instead and should immediately be cleared after they are used by invoking bufferVal.fill(0).
However, I have not come across in my study any example of keyboard text going straight into a Buffer. The best I can tell, everything I have found is intermediate strings, which I am trying to avoid.
If someone could help me find a mechanism for a NodeJS console keyboard input going straight to a Buffer instead of a string, that would be great!
See point number 5 in this answer if you are interested in what brought my concern.

CRC user's guide for file compare

Can someone point me to a CRC user's guide for file compare?
I have a requirement to use CRC to compare and confirm two files match. I have reviewed this site for how to use to use CRC with no real luck.
I have also looked for a CRC user's guide for file compare with no luck.
You compute the CRC on file 1. You compute the CRC on file 2. If the CRCs are not the same, then the files are different. If the CRCs are the same, then the files might also be the same. There is no assurance that the files are actually the same, unless you compare them directly.
You can get a pretty high probabilistic assurance that two files are the same if you use a long cryptographic hash, such as SHA-256. That gives you both a very low probability that two different files accidentally have the same SHA-256 (2–256 ~= 10–77), and it is considered to be not possible to modify a file to match the SHA-256 of another, different file. A CRC on the other hand is quite easy to spoof by someone who wants to fool you.

Why are there different STRING formats?

When some time ago I had developed a script to query network interfaces via snmpwalk and IF-MIB::ifDescr the output format was like STRING: eth0.
The OS was SLES11 using net-snmp (it still works in SLES12 using net-snmp-5.7.3).
However on a different OS (still Linux) the interface strings are represented as STRING: "port1" (note the surrounding double-quotes).
Now the question is: Who is responsible for the extra double quotes? A different version of net-snmp, or a different SNMP agent? Or is one of the results incorrectly implemented in the agent?
As far as I understand SNMP the double quotes are not necessary for the protocol as strings are always transmitted with their length.
While it would be unusual (and undesirable) for an SNMP Agent to provide a quoted string in response to a query for ifDescr (or for anything else!) as they are indeed not part of the contract of a string at that level, the SNMP world is rife with oddities and variations and specification deviations, so this is not something you can assume will never happen.
Meanwhile, the format of the command-line output of a tool like Net-SNMP is effectively arbitrary: the developers can choose whether or not to quote strings, and as long as they document their choice, the end result is the same. So you cannot make any assumptions here either.
You should examine the actual data. You can do this by sniffing the SNMP packets with a tool like tcpdump and loading them into a UI like Wireshark (previously Ethereal). Then you can observe the actual contents of the datagram without the Net-SNMP formatting. If it contains quotes, it's the agent's fault; if it doesn't, the app is adding them for display.
(There's probably a Net-SNMP flag to make it display the bytes, in hex form, making up the string, which would be an easier way to gather this evidence if I remembered what the flag was.)
As an editorial note, if you'd told us what the "different" Linux OS actually was, and what version of Net-SNMP you were using on it, we could have confirmed (or ruled out) option two for you.
(For what it's worth, I'm not aware of any Net-SNMP change that added or removed quotation marks from the command-line output, so this is probably an oddity of the agent on that "different" system.)

best way for search in rom

I want compare 32bit reg with rom 1024x32 .
best way for this search?
vhdl code
Sounds like you want a content-addressable memory (CAM).
The basic idea is that a CAM can be searched for values (32-bit word) to get keys (addresses). It does this by having a list of valid addresses per 32-bit word stored in some local memory.
Check out this application note by Xilinx for a more technical description.

Resources