CRYPTO NEWS

Unicity Distance redundancy clarification

I have an example of an exam question here:

The open message source is a language with an alphabet represented by an 8-bit ASCII code stored in a byte (=8 bits). The relative redundancy of the language is 50%. Calculate the maximum Unicity Distance for an AES cipher operating in the ECB cryptographic mode of operation with an input block size of 128 bits.

I can’t figure out how to get redundancy D to calculate Unicity Distance. I know that the answer is D=4. Any help?

Cryptozombies transferFrom function

What happens if function transferFrom is called by owner of _tokenId but with different _from parameter than msg.sender? require() is not checking that msg.sender is equal to _from so I can pass any address to _from and mess up ownerZombieCount mapping and emit false Transfer event. Am I failing to observe something? pragma solidity >=0.5.0::Listen

What happens if function transferFrom is called by owner of _tokenId but with different _from parameter than msg.sender? require() is not checking that msg.sender is equal to _from so I can pass any address to _from and mess up ownerZombieCount mapping and emit false Transfer event.

Am I failing to observe something?

pragma solidity >=0.5.0 <0.6.0;  import "./zombieattack.sol"; import "./erc721.sol";  contract ZombieOwnership is ZombieAttack, ERC721 {    mapping (uint => address) zombieApprovals;    function balanceOf(address _owner) external view returns (uint256) {     return ownerZombieCount[_owner];   }    function ownerOf(uint256 _tokenId) external view returns (address) {     return zombieToOwner[_tokenId];   }    function _transfer(address _from, address _to, uint256 _tokenId) private {     ownerZombieCount[_to]++;     ownerZombieCount[_from]--;     zombieToOwner[_tokenId] = _to;     emit Transfer(_from, _to, _tokenId);   }    function transferFrom(address _from, address _to, uint256 _tokenId) external payable {     require (zombieToOwner[_tokenId] == msg.sender || zombieApprovals[_tokenId] == msg.sender);     _transfer(_from, _to, _tokenId);   }    function approve(address _approved, uint256 _tokenId) external payable onlyOwnerOf(_tokenId) {     zombieApprovals[_tokenId] = _approved;     emit Approval(msg.sender, _approved, _tokenId);   } } 

Unicity Distance redundancy clarification

Shopping cart
There are no products in the cart!
Continue shopping
0