b'\n_START_ARTICLE_\nKontrollsumma\n_START_PARAGRAPH_\nKontrollsumma on informaatikas andmete tervikluse kontrollimiseks kasutatava algoritmi v\xc3\xa4ljund. Kontrollsumma saadakse kontrollsumma algoritmi rakendamisel kindlale andmehulgale. Kui p\xc3\xa4rast andmete edastamist (n\xc3\xa4iteks internetist faili allalaadimisel) kontrollsumma klapib esialgsete andmete kontrollsummaga, siis suure t\xc3\xb5en\xc3\xa4osusega pole edastamisel vigu esinenud._NEWLINE_Kahel v\xc3\xb5rdsel andmehulgal on alati sama kontrollsumma, kuid sama tulemuse v\xc3\xb5ivad anda ka erinevad andmehulgad. Seep\xc3\xa4rast kasutatakse kontrollsumma algoritmina tihti selliseid r\xc3\xa4sifunktsioone, mis juba sisendandmete v\xc3\xa4hesel muutmisel annavad drastiliselt erineva v\xc3\xa4ljundi. Selliseid algoritme (n\xc3\xa4iteks SHA-2) kasutatakse andmeturbes lisaks andmete terviklikkuse tagamisele ka andmete tahtliku muutmise v\xc3\xa4ltimiseks. Turvaekspert Bruce Schneier t\xc3\xb5estas 2005. aastal algoritmi MD5 murtavuse.\n_START_SECTION_\nN\xc3\xa4ited\n_START_PARAGRAPH_\nJ\xc3\xa4rgnevalt on toodud n\xc3\xa4iteid tihemini kasutatavate kontrollsumma algoritmide v\xc3\xa4ljunditest. V\xc3\xa4ljundid on esitatud kuueteistk\xc3\xbcmnends\xc3\xbcsteemis._NEWLINE_Kontrollsummad s\xc3\xb5nele "Tere, maailm!":_NEWLINE_MD5: ff5ddfa461bcc79dc5a75b066dcf4274_NEWLINE_SHA-1: 60087b35764744f3dac5f32b70715f6f4b2934f8_NEWLINE_SHA-256: 4341bd0611d3cac56d7ebf52b41ef2fb87a69a01a645794602633627aeb37bf1_NEWLINE_SHA-384: 94c82fc446d9ca2fa9113b1523d2ba343fdf6e959e8ba7c6b0ff76076c2d7697d5f14718136ae1e8e72a95326a8f5b95_NEWLINE_SHA-512: c4ea36e0cd5846be7690c94d5760c24a83343597102c8ef67f067e6f0b226cfebd0cf5ba921f0e4abe19b92000758d55ff6c86652e729ecf946f618483866f59_NEWLINE_Kontrollsummad s\xc3\xb5nele "Tere, maailm! " (lisatud t\xc3\xbchik l\xc3\xb5ppu):_NEWLINE_MD5: 867430efdfcd5180a6e7a8662f6dfb2b_NEWLINE_SHA-1: a0e84d2b45ddcd6cc202d317efc97f1e1c96071b_NEWLINE_SHA-256: 39a96937708c8f28671b71a48aad4d516f15388bc67dd01ad8b9ce5441702057_NEWLINE_SHA-384: 2e9a0b772e046c9c62e8bb0f17f116a6c46ca4f29e0d6643a91476411d291b90a974b270cacf1fc895b2a22351256a36_NEWLINE_SHA-512: e8f5b9ca94e8a4f9d506e96d9f361bc75097f71a45d13ce70094d2290bb5b03b1ee116facc1e1beb1e446ee5f85856542e2acfaabf115144cdea1e8f70a600ab\n_START_SECTION_\nJava\n_START_PARAGRAPH_\nKontrollsummade leidmine Javas, kontrollimaks eeltoodud n\xc3\xa4idet:_NEWLINE_import java.math.BigInteger;import java.security.MessageDigest;import java.security.NoSuchAlgorithmException;public class Checksum {_NEWLINE_public static String computeDigest(String algorithm, String message) {_NEWLINE_MessageDigest digest;_NEWLINE_try {_NEWLINE_digest = MessageDigest.getInstance(algorithm);_NEWLINE_} catch (NoSuchAlgorithmException e) {_NEWLINE_e.printStackTrace();_NEWLINE_return "";_NEWLINE_}_NEWLINE__NEWLINE_return new BigInteger(1, digest.digest(message.getBytes())).toString(16);_NEWLINE_}_NEWLINE__NEWLINE_public static void main(String[] args) {_NEWLINE_String message = "Tere, maailm!";_NEWLINE_String algorithms[] = {"MD5", "SHA-1", "SHA-256", "SHA-384", "SHA-512"};_NEWLINE__NEWLINE_for (String algorithm : algorithms) {_NEWLINE_System.out.format("%s\\t: %s\\n", algorithm, computeDigest(algorithm, message));_NEWLINE_}_NEWLINE_}}\n_START_SECTION_\nPHP\n_START_PARAGRAPH_\nPHP-s on v\xc3\xb5imalik lihtsasti kasutada md5-funktsiooni._NEWLINE_<?phpecho md5("Tere, maailm! ");?>'