Share to: share facebook share twitter share wa share telegram print page

Treyfer

Treyfer
General
DesignersGideon Yuval
First published1997
Cipher detail
Key sizes64 bits
Block sizes64 bits
Rounds32
Best public cryptanalysis
A slide attack using 232 known plaintexts and 244 work succeeds for any number of rounds

In cryptography, Treyfer is a block cipher/MAC designed in 1997 by Gideon Yuval. Aimed at smart card applications, the algorithm is extremely simple and compact; it can be implemented in just 29 bytes of 8051 machine code.[1]

Treyfer has a rather small key size and block size of 64 bits each. All operations are byte-oriented, and there is a single 8×8-bit S-box. The S-box is left undefined; the implementation can simply use whatever data is available in memory. In each round, each byte has added to it the S-box value of the sum of a key byte and the previous data byte, then it is rotated left one bit. The design attempts to compensate for the simplicity of this round transformation by using 32 rounds.

Due to the simplicity of its key schedule, using the same eight key bytes in each round, Treyfer was one of the first ciphers shown to be susceptible to a slide attack. This cryptanalysis, which is independent of the number of rounds and the choice of S-box, requires 232 known plaintexts and 244 computation time.

Implementation

A simple implementation of Treyfer can be done as follows[2]

#include <stdint.h>

#define NUMROUNDS 32
extern uint8_t const sbox[256];

void treyfer_encrypt(uint8_t * text[8], uint8_t const key[8]) {
    unsigned i;
    uint8_t t = *text[0];

    for (i = 0; i < 8 * NUMROUNDS; i++) {
        t += key[i % 8];
        t = sbox[t] + *text[(i + 1) % 8];
        t = (t << 1) | (t >> 7);        /* Rotate left 1 bit */
        *text[(i + 1) % 8] = t;
    }
}

void encrypt(uint8_t * text[8], uint8_t const key[8]) {
    unsigned int i = 0;
    unsigned int j = 0;
    uint8_t t = 0;

    t = text[0];
    for (j = 0; j < NUMROUNDS; j++) {
        for (i = 0; i < 8; i++) {
            t = t + key[i];
            t = sbox[t] + *text[(i + 1) % 8];
            t = (t << 1) | (t >> 7);
            *text[(i + 1) % 8] = t;
        }
    }
}

void decrypt(uint8_t *text[8], uint8_t const key[8]) {
    int i = 0;
    int j = 0;
    uint8_t top = 0;
    uint8_t bottom = 0;

    for (j = 0; j < NUMROUNDS; j++) {
        for (i = 7; i >= 0; i--) {
            top = *text[i] + key[i];
            top = sbox[top];
            bottom = *text[(i + 1) % 8];
            bottom = (bottom >> 1) | (bottom << 7);
            *text[(i + 1) % 8] = bottom - top;
        }
    }
}

See also

References

  1. ^ "A Related-Key Attack on Treyfer" (PDF). encs.concordia.ca. Retrieved 2024-04-01.
  2. ^ "C implementation of Treyfer". Stackoverflow.com. Retrieved 2022-11-27.


Read other articles:

Language official or recognized in several countries The PALOP (Países Africanos de Língua Oficial Portuguesa), highlighted in red Portuguese is spoken in a number of African countries and is the official language in six African countries: Angola, Mozambique, Guinea-Bissau, Cape Verde, São Tomé and Príncipe and Equatorial Guinea. There are Portuguese-speaking communities in most countries of Southern Africa, a mixture of Portuguese settlers and Angolans and Mozambicans who left their countr…

SMA Negeri 2 ParepareInformasiDidirikan1978JenisNegeriKepala SekolahDrs. TajrinJurusan atau peminatanIlmu alam dan Ilmu sosial (KTSP) dan MIA dan IIS (Kurikulum 2013)Rentang kelasX, XI IPA/IPS, XII IPA/IPS, dan Akselerasi (KTSP) dan X MIA/IIS, XI MIA/IIS, dan Akselerasi (Kurikulum 2013)KurikulumKurikulum Tingkat Satuan Pendidikan (Kelas XII dan Akselerasi Angkatan Ketiga) dan Kurikulum 2013 (Kelas X, XI, dan Akselerasi Angkatan Keempat)StatusSekolah Standar NasionalAlamatLokasiJl. Jend. Sud…

artikel ini tidak memiliki pranala ke artikel lain. Tidak ada alasan yang diberikan. Bantu kami untuk mengembangkannya dengan memberikan pranala ke artikel lain secukupnya. (Pelajari cara dan kapan saatnya untuk menghapus pesan templat ini) ADEOS II (Advanced Earth Observing Satellite 2) adalah satelit observasi bumi diluncurkan oleh NASDA, NASA dan CNES pada bulan Desember 2002. Nama Jepang nya adalah Midori 2, dan itu adalah penerus misi 1996 ADEOS I. misi berakhir pada bulan Oktober 2003 sete…

2019 Indian Punjabi-language comedy-drama film Chal Mera PuttTheatrical film posterDirected byJanjot SinghScreenplay byRakesh DhawanKulwant SinghStory byRakesh DhawanProduced byKaraj GillAshu Munish SahniStarringAmrinder GillSimi ChahalIftikhar ThakurNasir ChinyotiAkram UdasRup KhatkarHardeep GillGurshabadCinematographySandeep PatilEdited bySadik Ali ShaikhMusic byDr ZeusGurcharan SinghProductioncompaniesRhythm Boyz EntertainmentGillz NetworkOmjee Star StudiosDistributed byOmjee Star StudiosRhyt…

У Вікіпедії є статті про інші географічні об’єкти з назвою Мансфілд. Селище Мансфілд Тауншипангл. Mansfield Township Координати 40°05′14″ пн. ш. 74°42′44″ зх. д. / 40.08740000002777748° пн. ш. 74.71230000002778127° зх. д. / 40.08740000002777748; -74.71230000002778127Координати: 40°05′14″ пн. …

La primavera es una de las cuatro estaciones del año, sigue al invierno y precede al verano. La definición y duración de la misma varía, desde el punto de vista meteorológico; es propia de las zonas templadas y corresponde a un tiempo intermedio —entretiempo—[1]​ entre la estación fría, el invierno, y la cálida, el verano. Desde el punto de vista de la astronomía, comienza tras el equinoccio de primavera y termina tras el solsticio de verano.[2]​ En el calendario la prim…

D Ubicación geográficaContinente Estados UnidosDesembocadura Océano PacíficoCoordenadas 44°58′02″N 124°00′55″O / 44.9672222, -124.0152778Ubicación administrativaPaís Estados UnidosLincoln City OregónLocalidad OregónPresaTipo naturalCuerpo de aguaRíos drenados Devils LakeLongitud 130 metrosProfundidad Media: 2.5 metrosMáxima: 3 metros[editar datos en Wikidata] El río D es un río de Oregón, Estados Unidos, el más corto del mundo[1]​[2]​…

Halaman ini berisi artikel tentang merek permainan video. Untuk konsolnya, lihat PlayStation (konsol). PlayStationJenis produkKonsol permainan videoPemilikSony Interactive EntertainmentNegaraMinami-Aoyama, Minato, Tokyo, JepangDiluncurkan3 Desember 1994; 28 tahun lalu (1994-12-03)PasarSeluruh duniaSitus webwww.playstation.comPlayStation (プレイステーションcode: ja is deprecated , pureisutēshon, disingkat PS) merupakan jajaran merek konsol permainan video rumahan, serta pusat media…

Ancient philosophical, research and educative center, founded by Plato This article is about the academy founded by Plato. For the 15th-century school in Florence, see Platonic Academy (Florence). For the Raphael painting, see The School of Athens. Akademia redirects here. For the French early music ensemble, see Akadêmia. 37°59′33″N 23°42′29″E / 37.99250°N 23.70806°E / 37.99250; 23.70806 Part of a series onPlatonismPlato from Raphael's The School of Athens (…

2021 single by Mod Sun featuring Avril LavigneFlamesSingle by Mod Sun featuring Avril Lavignefrom the album Internet Killed the Rockstar ReleasedJanuary 8, 2021 (2021-01-08)Recorded2020Genre Emo pop[1] pop punk[2] pop[3] punk rock[4] Length2:31LabelBig NoiseSongwriter(s) Avril Lavigne Derek Smith John Feldmann Producer(s)John FeldmannMod Sun singles chronology Bones (2020) Flames (2021) Heavy (2021) Avril Lavigne singles chronology We Are Wa…

Westsächsische Hochschule Zwickau Motto Hochschule für Mobilität Gründung 1897 Trägerschaft staatlich Ort Zwickau Bundesland Sachsen Sachsen Land Deutschland Deutschland Rektor Stephan Kassel Studierende 3.300 WS 2021/2022 Netzwerke DFH[1], DHIK, csnd, Silicon Saxony, Saxony⁵[2], GPM Website www.whz.de Georgius-Agricola-Bau am Dr.-Friedrichs-Ring Die Westsächsische Hochschule Zwickau – Hochschule für angewandte Wissenschaften (WHZ – University of Applied Sc…

English comedian and television personality (born 1972) Karl PilkingtonPilkington in 2008Born (1972-09-23) 23 September 1972 (age 51)Sale, EnglandOccupationsPresentercomedianactorvoice-artistproducerauthorYears active1998–presentPartnerSuzanneWebsitekarlpilkington.co.uk Karl Pilkington (born 23 September 1972) is an English presenter, comedian,[citation needed] actor, voice-artist, producer and author. After working with Ricky Gervais and Stephen Merchant as producer on their…

Нижегородский государственный агротехнологический университет(НГАТУ) Прежнее название Горьковский сельскохозяйственный институт, Нижегородская государственная сельскохозяйственная академия Тип государственный Ректор Воротников Игорь Леонидович (и.о.) Расположение …

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Nguyễn Văn Linh – news · newspapers · books · scholar · JSTOR (September 2021) (Learn how and when to remov…

Dialect of Punjabi Not to be confused with the Malvi language of Rajasthan and Madhya Pradesh. Malwaiਮਲਵਈ • ملوئیNative toIndia, PakistanRegionMalwa (Punjab)Language familyIndo-European Indo-IranianIndo-AryanNorthwesternPunjabiEastern PunjabiMalwaiEarly formOld Punjabi[1][2][3][4][5][6] Writing systemGurmukhīShahmukhiLanguage codesISO 639-3– Part of a series onPunjabis History Folklore Language Dialects Punjab Punjabis Nation…

American actress, comedian, writer, and producer (born 1952) Roseanne BarrFrom the 2010 documentary I Am ComicBornRoseanne Cherrie Barr (1952-11-03) November 3, 1952 (age 71)Salt Lake City, Utah, U.S.Occupation(s)Actress, comedian, writer, producerYears active1970–presentPolitical partyPeace and Freedom (2012–2013)Green (2008–2012)Democratic (before 2008)Spouses Bill Pentland ​ ​(m. 1974; div. 1990)​ Tom Arnold ​ ​&#…

Galy RecordsFounded2002FounderEric GalyStatusActiveDistributor(s)F.A.B.GenreExtreme metalCountry of originCanadaLocationVerdun, QuebecOfficial websitewww.galyrecords.com Galy Records is a Canadian independent record label based in Verdun, Quebec, founded by Eric Galy in 2002.[1][2] The label includes albums released for bands such as Dead Brain Cells, Neuraxis, Despised Icon, Gorguts, Unexpect, Infernäl Mäjesty, Anvil, Beneath the Massacre, Coprofago, Ion Dissonance, Martyr, An…

Tujuh daerah pertumbuhan siklon tropis beserta pusat peringatan dini siklon tropis Siklon tropis di seluruh penjuru dunia secara tradisional terbentuk di tujuh daerah pertumbuhan siklon tropis (basin). Daerah pertumbuhan siklon tropis tersebut meliputi wilayah utara Samudera Atlantik, bagian barat dan timur wilayah utara Samudera Pasifik, wilayah barat daya Samudera Pasifik, wilayah barat daya dan tenggara Samudra Hindia, dan wilayah utara Samudra Hindia (Laut Arab dan Teluk Benggala). Daerah pe…

Wife First editionAuthorBharati MukherjeeCountryUnited StatesLanguageEnglishPublished1975 Houghton MifflinMedia typePrint (paperback)Pages213 ppISBN0-395-20439-9OCLC1176882Dewey Decimal813/.5/4LC ClassPZ4.M9555 Wi3 PR9499.3.M77Preceded byThe Tiger's Daughter (1971) Followed byDarkness (1985)  Wife (1975) is a novel by Bharati Mukherjee.The book was originally published by Houghton Mifflin. [1][2][3][4][5] Plot summary This is …

British Army general (1862–1950) Sir Aylmer HaldaneSir Aylmer Haldane, photographed around 1900Born(1862-11-17)17 November 1862Gleneagles, ScotlandDied19 April 1950(1950-04-19) (aged 87)London, EnglandBuriedBrookwood CemeteryService/branch British ArmyYears of service1882–1925RankGeneralUnitGordon HighlandersCommands held10th Infantry Brigade3rd Division6th Army CorpsBattles/warsNorth West FrontierRusso-Japanese War - Military AttacheSecond Boer WarWorld War IInsurrection of Mesopo…

Kembali kehalaman sebelumnya

Lokasi Pengunjung: 3.12.149.139