<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technology Archives - Sequent</title>
	<atom:link href="/tech/feed/" rel="self" type="application/rss+xml" />
	<link>/tech/</link>
	<description>Online Voting Platform</description>
	<lastBuildDate>Wed, 29 May 2024 17:03:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.7</generator>

<image>
	<url>/wp-content/uploads/2022/06/cropped-FAV-6-32x32.png</url>
	<title>Technology Archives - Sequent</title>
	<link>/tech/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Blockchains and Bulletin Boards</title>
		<link>/tech/blockchains-and-bulletin-boards/</link>
		
		<dc:creator><![CDATA[Serhii Bohynia]]></dc:creator>
		<pubDate>Mon, 26 Jun 2023 08:21:36 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[blog]]></category>
		<guid isPermaLink="false">/?p=1811</guid>

					<description><![CDATA[<p>Bulletin boards play a vital role in ensuring the integrity and verifiability of cryptographically secure voting systems. Acting as a centralized storage system, the bulletin board serves as a transparent platform where all public information related to the election is openly published, enabling anyone to scrutinise, assess, and audit the process. Go Back Blog Add [&#8230;]</p>
<p>The post <a href="/tech/blockchains-and-bulletin-boards/">Blockchains and Bulletin Boards</a> appeared first on <a href="/">Sequent</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="1811" class="elementor elementor-1811" data-elementor-post-type="post">
				<div class="elementor-element elementor-element-6974651 e-flex e-con-boxed e-con e-parent" data-id="6974651" data-element_type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-6dcc8e3 elementor-widget elementor-widget-text-editor" data-id="6dcc8e3" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
			<style>/*! elementor - v3.21.0 - 26-05-2024 */
.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}</style>				<p>Bulletin boards play a vital role in ensuring the integrity and verifiability of cryptographically secure voting systems. Acting as a centralized storage system, the bulletin board serves as a transparent platform where all public information related to the election is openly published, enabling anyone to scrutinise, assess, and audit the process.</p>						</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-3447a5e0 e-flex e-con-boxed e-con e-parent" data-id="3447a5e0" data-element_type="container" data-settings="{&quot;background_background&quot;:&quot;classic&quot;}">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-5a8969a e-con-full e-flex elementor-invisible e-con e-child" data-id="5a8969a" data-element_type="container" data-settings="{&quot;animation&quot;:&quot;fadeInLeft&quot;}">
				<div class="elementor-element elementor-element-639fd078 elementor-widget elementor-widget-button" data-id="639fd078" data-element_type="widget" data-widget_type="button.default">
				<div class="elementor-widget-container">
					<div class="elementor-button-wrapper">
			<a class="elementor-button elementor-button-link elementor-size-sm" href="/blog/">
						<span class="elementor-button-content-wrapper">
						<span class="elementor-button-icon elementor-align-icon-left">
				<i aria-hidden="true" class="fas fa-angle-left"></i>			</span>
									<span class="elementor-button-text">Go Back</span>
					</span>
					</a>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-4b7e57c1 elementor-widget elementor-widget-heading" data-id="4b7e57c1" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<style>/*! elementor - v3.21.0 - 26-05-2024 */
.elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]>a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px}</style><div class="elementor-heading-title elementor-size-default">Blog</div>		</div>
				</div>
				<div class="elementor-element elementor-element-34a1f97d elementor-widget__width-inherit elementor-widget elementor-widget-theme-post-title elementor-page-title elementor-widget-heading" data-id="34a1f97d" data-element_type="widget" data-widget_type="theme-post-title.default">
				<div class="elementor-widget-container">
			<h1 class="elementor-heading-title elementor-size-default">Blockchains and Bulletin Boards</h1>		</div>
				</div>
				<div class="elementor-element elementor-element-2d99679d elementor-widget elementor-widget-text-editor" data-id="2d99679d" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<span>Blog</span>, <span>Technology</span>						</div>
				</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-ff757c9 e-flex e-con-boxed e-con e-parent" data-id="ff757c9" data-element_type="container">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-4d1065a4 e-con-full e-flex e-con e-child" data-id="4d1065a4" data-element_type="container">
				<div class="elementor-element elementor-element-7f793013 uael-heading-align-left elementor-widget elementor-widget-uael-table-of-contents" data-id="7f793013" data-element_type="widget" data-settings="{&quot;heading_bottom_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:0,&quot;sizes&quot;:[]},&quot;content_between_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:16,&quot;sizes&quot;:[]},&quot;sticky&quot;:&quot;top&quot;,&quot;sticky_on&quot;:[&quot;desktop&quot;,&quot;tablet&quot;],&quot;scroll_offset&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;scroll_offset_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;scroll_offset_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;heading_text_align&quot;:&quot;left&quot;,&quot;heading_bottom_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;heading_bottom_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;content_between_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;content_between_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;sticky_offset&quot;:0,&quot;sticky_effects_offset&quot;:0}" data-widget_type="uael-table-of-contents.default">
				<div class="elementor-widget-container">
					<div class="uael-toc-main-wrapper" data-headings="h2,h3" >
			<div class="uael-toc-wrapper">
				<div class="uael-toc-header">
					<span class="uael-toc-heading elementor-inline-editing" data-elementor-setting-key="heading_title" data-elementor-inline-editing-toolbar="basic" ></span>
									</div>
								<div class="uael-toc-toggle-content">
					<div class="uael-toc-content-wrapper">
						
							<ul data-toc-headings="headings" class="uael-toc-list uael-toc-list-none" data-scroll="500" ></ul>
											</div>
				</div>
				<div class="uael-toc-empty-note">
					<span>Add a header to begin generating the table of contents</span>
				</div>
			</div>
					</div>
				</div>
				</div>
				</div>
		<div class="elementor-element elementor-element-2c573c8e e-con-full e-flex e-con e-child" data-id="2c573c8e" data-element_type="container">
				<div class="elementor-element elementor-element-3bb061cb elementor-widget elementor-widget-image" data-id="3bb061cb" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
			<style>/*! elementor - v3.21.0 - 26-05-2024 */
.elementor-widget-image{text-align:center}.elementor-widget-image a{display:inline-block}.elementor-widget-image a img[src$=".svg"]{width:48px}.elementor-widget-image img{vertical-align:middle;display:inline-block}</style>										<img fetchpriority="high" decoding="async" width="590" height="271" src="/wp-content/uploads/2024/03/blockchain-img.png" class="attachment-full size-full wp-image-1815" alt="" srcset="/wp-content/uploads/2024/03/blockchain-img.png 590w, /wp-content/uploads/2024/03/blockchain-img-300x138.png 300w" sizes="(max-width: 590px) 100vw, 590px" />													</div>
				</div>
				<div class="elementor-element elementor-element-4584202 elementor-widget elementor-widget-heading" data-id="4584202" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Introduction</h2>		</div>
				</div>
		<div class="elementor-element elementor-element-4180cbb7 e-flex e-con-boxed e-con e-child" data-id="4180cbb7" data-element_type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-562ecf63 elementor-widget elementor-widget-text-editor" data-id="562ecf63" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Bulletin boards play a vital role in ensuring the integrity and verifiability of cryptographically secure voting systems. Acting as a centralized storage system, the bulletin board serves as a transparent platform where all public information related to the election is openly published, enabling anyone to scrutinise, assess, and audit the process. In the realm of end-to-end verifiable voting systems, the bulletin board becomes even more significant as it holds crucial information required to validate the adherence to established protocols, confirm the accuracy of the reported results, and safeguard against any potential manipulation by administrators or other entities.</p><p>In a typical scenario, the bulletin board acts as a repository for various essential components of a voting system. It securely stores crucial information, including public keys and key generation specifics, records of voting events and encrypted votes, decryption and tally results, and robust mathematical proofs validating the accuracy of these elements. Moreover, the bulletin board assumes the role of an audit ledger, diligently logging significant events and actions, and providing a transparent record that can be accessed and reviewed by anyone seeking to ensure the system’s integrity.</p><p>There are some desirable properties that bulletin boards must have to better meet their objectives:</p>						</div>
				</div>
					</div>
				</div>
				<div class="elementor-element elementor-element-306daba2 elementor-widget elementor-widget-heading" data-id="306daba2" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">1. Distributed
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-e89c4fe elementor-widget elementor-widget-text-editor" data-id="e89c4fe" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>In this way, elections can continue to be conducted despite DDOS attacks. In order to achieve this property, hard problems such as byzantine consensus and distribution engineering challenges must be resolved.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-bae6089 elementor-widget elementor-widget-heading" data-id="bae6089" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">2. Chronological
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-3fc70a95 elementor-widget elementor-widget-text-editor" data-id="3fc70a95" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Logging of events and data on the bulletin board should reflect the order in which they occur.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-9180a64 elementor-widget elementor-widget-heading" data-id="9180a64" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">3. Tamper-Resistant
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-e48f905 elementor-widget elementor-widget-text-editor" data-id="e48f905" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>It should not be possible to manipulate results or remove records from the audit log by altering bulletin board records.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-c153f41 elementor-widget elementor-widget-heading" data-id="c153f41" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">4. Publically Auditable
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-2b14d21 elementor-widget elementor-widget-text-editor" data-id="2b14d21" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Information on bulletin boards should be auditable by anyone. Specifically, this property should be supportive of end-to-end verifiability.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-aab5ce5 elementor-widget elementor-widget-heading" data-id="aab5ce5" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">5. Access Controlled and Authenticated
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-018bb4e elementor-widget elementor-widget-text-editor" data-id="018bb4e" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>A bulletin board should include mechanisms for controlling what information can be posted, as well as digital signatures for information and receipts for certification.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-649f6811 elementor-widget elementor-widget-heading" data-id="649f6811" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">In Summary
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-42c5c051 elementor-widget elementor-widget-text-editor" data-id="42c5c051" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Developing a robust bulletin board using blockchain technologies could be a fascinating research project. As well as offering some support for signatures, blockchain technology seems particularly well suited to satisfy distribution, chronology, tamper resistance, and auditing needs. To ensure that the throughput is compatible with voting needs, efficiency considerations regarding the number of “transactions” per second would also need to be considered.</p>						</div>
				</div>
				</div>
					</div>
				</div>
				</div>
		<p>The post <a href="/tech/blockchains-and-bulletin-boards/">Blockchains and Bulletin Boards</a> appeared first on <a href="/">Sequent</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>A bag of Dev Container Tricks</title>
		<link>/tech/a-bag-of-dev-container-tricks/</link>
		
		<dc:creator><![CDATA[Serhii Bohynia]]></dc:creator>
		<pubDate>Fri, 03 Mar 2023 11:03:15 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[blog]]></category>
		<guid isPermaLink="false">/?p=1941</guid>

					<description><![CDATA[<p>Nowadays, threre are a lot of tools, libraries, IDEs &#38; plugins that are supposed to make the life of developers easier. But this also adds complexity. Moreover, it may make each developer’s development environment a bit different, depending on how the developer configured these tools. Go Back Blog Add a header to begin generating the [&#8230;]</p>
<p>The post <a href="/tech/a-bag-of-dev-container-tricks/">A bag of Dev Container Tricks</a> appeared first on <a href="/">Sequent</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="1941" class="elementor elementor-1941" data-elementor-post-type="post">
				<div class="elementor-element elementor-element-5b274f6d e-flex e-con-boxed e-con e-parent" data-id="5b274f6d" data-element_type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-7033392d elementor-widget elementor-widget-text-editor" data-id="7033392d" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Nowadays, threre are a lot of tools, libraries, IDEs &amp; plugins that are supposed to make the life of developers easier. But this also adds complexity. Moreover, it may make each developer’s development environment a bit different, depending on how the developer configured these tools.</p>						</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-379b0e e-flex e-con-boxed e-con e-parent" data-id="379b0e" data-element_type="container" data-settings="{&quot;background_background&quot;:&quot;classic&quot;}">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-64dc1476 e-con-full e-flex elementor-invisible e-con e-child" data-id="64dc1476" data-element_type="container" data-settings="{&quot;animation&quot;:&quot;fadeInLeft&quot;}">
				<div class="elementor-element elementor-element-4ffae7cb elementor-widget elementor-widget-button" data-id="4ffae7cb" data-element_type="widget" data-widget_type="button.default">
				<div class="elementor-widget-container">
					<div class="elementor-button-wrapper">
			<a class="elementor-button elementor-button-link elementor-size-sm" href="/blog/">
						<span class="elementor-button-content-wrapper">
						<span class="elementor-button-icon elementor-align-icon-left">
				<i aria-hidden="true" class="fas fa-angle-left"></i>			</span>
									<span class="elementor-button-text">Go Back</span>
					</span>
					</a>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-36bff9a8 elementor-widget elementor-widget-heading" data-id="36bff9a8" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<div class="elementor-heading-title elementor-size-default">Blog</div>		</div>
				</div>
				<div class="elementor-element elementor-element-41dd07d0 elementor-widget__width-inherit elementor-widget elementor-widget-theme-post-title elementor-page-title elementor-widget-heading" data-id="41dd07d0" data-element_type="widget" data-widget_type="theme-post-title.default">
				<div class="elementor-widget-container">
			<h1 class="elementor-heading-title elementor-size-default">A bag of Dev Container Tricks</h1>		</div>
				</div>
				<div class="elementor-element elementor-element-37a74cd0 elementor-widget elementor-widget-text-editor" data-id="37a74cd0" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<span>Blog</span>, <span>Technology</span>						</div>
				</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-7912d8b2 e-flex e-con-boxed e-con e-parent" data-id="7912d8b2" data-element_type="container">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-4ade4524 e-con-full e-flex e-con e-child" data-id="4ade4524" data-element_type="container">
				<div class="elementor-element elementor-element-555c9877 uael-heading-align-left elementor-widget elementor-widget-uael-table-of-contents" data-id="555c9877" data-element_type="widget" data-settings="{&quot;heading_bottom_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:0,&quot;sizes&quot;:[]},&quot;content_between_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:16,&quot;sizes&quot;:[]},&quot;sticky&quot;:&quot;top&quot;,&quot;sticky_on&quot;:[&quot;desktop&quot;,&quot;tablet&quot;],&quot;scroll_offset&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;scroll_offset_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;scroll_offset_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;heading_text_align&quot;:&quot;left&quot;,&quot;heading_bottom_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;heading_bottom_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;content_between_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;content_between_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;sticky_offset&quot;:0,&quot;sticky_effects_offset&quot;:0}" data-widget_type="uael-table-of-contents.default">
				<div class="elementor-widget-container">
					<div class="uael-toc-main-wrapper" data-headings="h2,h3" >
			<div class="uael-toc-wrapper">
				<div class="uael-toc-header">
					<span class="uael-toc-heading elementor-inline-editing" data-elementor-setting-key="heading_title" data-elementor-inline-editing-toolbar="basic" ></span>
									</div>
								<div class="uael-toc-toggle-content">
					<div class="uael-toc-content-wrapper">
						
							<ul data-toc-headings="headings" class="uael-toc-list uael-toc-list-none" data-scroll="500" ></ul>
											</div>
				</div>
				<div class="uael-toc-empty-note">
					<span>Add a header to begin generating the table of contents</span>
				</div>
			</div>
					</div>
				</div>
				</div>
				</div>
		<div class="elementor-element elementor-element-4138b184 e-con-full e-flex e-con e-child" data-id="4138b184" data-element_type="container">
				<div class="elementor-element elementor-element-63d6b307 elementor-widget elementor-widget-image" data-id="63d6b307" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img decoding="async" width="768" height="403" src="/wp-content/uploads/2024/03/a-bag-of-dev-container-tricks-768x403-1.png" class="attachment-full size-full wp-image-1942" alt="" srcset="/wp-content/uploads/2024/03/a-bag-of-dev-container-tricks-768x403-1.png 768w, /wp-content/uploads/2024/03/a-bag-of-dev-container-tricks-768x403-1-300x157.png 300w" sizes="(max-width: 768px) 100vw, 768px" />													</div>
				</div>
		<div class="elementor-element elementor-element-3a2c9086 e-flex e-con-boxed e-con e-child" data-id="3a2c9086" data-element_type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-53ab8225 elementor-widget elementor-widget-text-editor" data-id="53ab8225" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">Nowadays, threre are a lot of tools, libraries, IDEs &amp; plugins that are supposed to make the life of developers easier. But this also adds complexity. Moreover, it may make each developer’s development environment a bit different, depending on how the developer configured these tools.</p><p dir="auto"><a href="https://containers.dev/" rel="nofollow">Dev Containers</a> are yet another one of those tools, but they’re one of the most promising projects to solve this issue. Rather than configuring your local environment and fighting against your local machine configuration and needs, you can crowdsource them.</p><p dir="auto">With Dev Containers, any developer can improve the configuration of their development environment. The whole development environment is code: programmable, reproducible, and outsourceable.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-187f49f elementor-widget elementor-widget-heading" data-id="187f49f" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Drifting hidden state
</h2>		</div>
				</div>
					</div>
				</div>
				<div class="elementor-element elementor-element-15d3fcd elementor-widget elementor-widget-text-editor" data-id="15d3fcd" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">Traditionally, you have a long-term personal investment in your development environment. Since it’s only for you and you configured it manually, you don’t really want to touch it or invest time on it – it’d be time wasted! As project and tool complexity has increased, it has only gotten worse.</p><p dir="auto">After some time, you update your Operating System. A new version of Rust is now required for this project and you have to install it. VS Code tells you that there’s a new release, just restart it to apply. The project you are developing now requires newer PostgreSQL installation. You keep being forced to adapt locally to all these changes to maintain a working development environment. And you spend as little as possible on this adaptation, since it’s time wasted.</p><p dir="auto">Sometimes one of these changes starts giving you headaches. You upgraded PostgreSQL for project A, but then Project B stopped working. Or you upgraded your OS and a library is not found. You get the idea.</p><p dir="auto">You end up having an ever-changing, undocumented, unreproducible hidden state. You fear the day in which your computer fails and you will have to set up all this again from zero. With no extra benefit, having to spend maybe a whole day just to get things to a state you already had.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-0df8f2b elementor-widget elementor-widget-heading" data-id="0df8f2b" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Solve all the above
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-4fdd4309 elementor-widget elementor-widget-text-editor" data-id="4fdd4309" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">Dev Containers is not the only tool that tries to solve the hidden state problem. Nix or virtualenv also try to ameliorate it. But it’s a promising approach because it’s quite comprehensive. More than it looks at first-glance.</p><p dir="auto">However, like any new technology, Dev Containers have their own peculiarities. What follows is a bag of tricks and tips of our own, in no particular order:</p>						</div>
				</div>
				<div class="elementor-element elementor-element-4d84355 elementor-widget elementor-widget-heading" data-id="4d84355" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trick #1: Remote containers
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-6697165a elementor-widget elementor-widget-text-editor" data-id="6697165a" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">Dev Containers run the software in a container – you already knew that. This can consume some more resources (RAM and CPU) and make compilation and other processes slower than just running all those natively in your PC.</p><p dir="auto">The above is true only if you don’t take advantage of what containers allow. For example, maybe you have a slim or old laptop with little resources, but you have a badass server at home where you can run the containers. You can easily <a href="https://code.visualstudio.com/remote/advancedcontainers/develop-remote-host" rel="nofollow">run the docker containers remotely</a> in that server. Suddenly, your computer is a simple thin client with little need for extra resources. You can compile, rebuild, and launch services within VS Code and your laptop’s CPU and RAM usage won’t suffer.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-1b8ed885 elementor-widget elementor-widget-heading" data-id="1b8ed885" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trick #2: Github Codespaces
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-388bc063 elementor-widget elementor-widget-text-editor" data-id="388bc063" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">Trick #1 above is fine but requires:</p><ol dir="auto"><li>Having a secondary machine with spare resources.</li><li>Configuring this machine to be a remote docker host.</li></ol><p dir="auto">If you don’t have (1) or if you are just lazy to do (2) like I am, then I’ve got a better alternative for you: <a href="https://docs.github.com/en/codespaces">Github Codespaces</a>. It allows you to do pretty much the same, except the containers are going to be run automatically by Github in Microsoft Azure cloud. For personal accounts, this includes currently <a href="https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts">60 free hours per month</a>, which is not too shabby.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-a4d7501 elementor-widget elementor-widget-heading" data-id="a4d7501" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trick #3: Prebuilds for Github Codespaces</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-7b8cbada elementor-widget elementor-widget-text-editor" data-id="7b8cbada" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">You can configure the Dev Container to execute a command with <code>onCreateCommand</code> when the container is created, for example configuring and building your source code and fetching all the dependencies. However, building the docker images and performing from scratch all those steps each time you spin a new Dev container environment can take a while, sometimes even more than 20 minutes or more. That is NOT good. You don’t want to wait half an hour just to start coding!</p><p dir="auto">Github has you covered here. <a href="https://docs.github.com/en/codespaces/prebuilding-your-codespaces/about-github-codespaces-prebuilds">prebuilds to the rescue</a>. Prebuilds help to speed up the creation of new codespaces by performing these expenses steps and generating a ready-to-use Dev container image when you push changes to your repository. Bottom line is: instead of 30 minutes to spin a new codespace, now it’s maybe a minute and your code is freshly already compiled and ready to go. Feels like magic in comparison.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-c475fd3 elementor-widget elementor-widget-heading" data-id="c475fd3" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trick #4: nix-devcontainer</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-64e5644e elementor-widget elementor-widget-text-editor" data-id="64e5644e" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">Nix makes builds reproducible and thus safer, so we wanted to use it as a package manager. Unfortunately, some vscode extensions do not integrate well with Nix. To workaround this issue, we use <a href="https://github.com/xtruder/nix-devcontainer">xtruder/nix-devcontainer</a> which applies a <em>hack</em> that fixes it by preloading a given set of extensions, for example <a href="https://marketplace.visualstudio.com/items?itemName=arrterian.nix-env-selector" rel="nofollow">arrterian.nix-env-selector</a>, before any other.</p><p dir="auto">Without this, you would otherwise have to for example install rust toolchain twice: one with nix for your flake, and another via apt-get for VS Code to work properly. Not anymore!</p>						</div>
				</div>
				<div class="elementor-element elementor-element-5c61c00 elementor-widget elementor-widget-heading" data-id="5c61c00" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trick #5: Leveraging Cachix
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-7343531e elementor-widget elementor-widget-text-editor" data-id="7343531e" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><p dir="auto"><a href="https://cachix.org/" rel="nofollow">cachix</a> is the most-well known online service cache for Nix. We use it in Github Actions to speed them up and we use it also in the prebuilds mentioned earlier, so that the prebuild process happens faster.</p><p dir="auto">Within the <a href="https://nixos.wiki/wiki/Flakes" rel="nofollow">flake.nix</a> of your package, you can use <a href="https://nixos.wiki/wiki/Flakes#Flake_schema" rel="nofollow">nixConfig</a> to setup access to your public nix cache for any user to take advantage of, <a href="https://github.com/sequentech/bulletin-board/blob/main/flake.nix#L130">just like we do here</a>:</p></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-d8bb254 elementor-widget elementor-widget-code-highlight" data-id="d8bb254" data-element_type="widget" data-widget_type="code-highlight.default">
				<div class="elementor-widget-container">
					<div class="prismjs-default copy-to-clipboard ">
			<pre data-line="" class="highlight-height language-javascript line-numbers">
				<code readonly="true" class="language-javascript">
					<xmp>{
  # ...
  nixConfig = {
    extra-substituters = [ "https://sequentech.cachix.org/" ];
    extra-trusted-public-keys = [ "sequentech.cachix.org-1:mmoak2RFNZkQjHHpKn/NbsBrznWqvq8COKqaVOI6ahM=" ];
  };
}</xmp>
				</code>
			</pre>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-174ed1f elementor-widget elementor-widget-text-editor" data-id="174ed1f" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="highlight highlight-source-nix" dir="auto"><p>Now when a user runs <code>nix develop</code>, it will launch the flake’s default <code>devShell</code> but instead of building everything from scratch, it will have read access to the same nix cache as everyone else.</p><p><strong>However</strong>, it will be first asked to trust this third-party cache. And this is a nice security feature, but might be annoying for example when running commands within the <code>nix develop</code> environment in the prebuild setup script. To fix this, you can either:</p></div><p dir="auto">a) Run any Nix command with an extra <code>--accept-flake-config</code> parameter. </p><p dir="auto">b) Configure your Dockerfile to do that by default as we do in <a href="https://github.com/sequentech/bulletin-board/blob/main/.devcontainer/Dockerfile#L6">Dockerfile</a> and <a href="https://github.com/sequentech/bulletin-board/blob/main/.devcontainer/etc/nix.conf#L6">nix.conf</a>.</p><p dir="auto">Another way to leverage Cachix in Rust projects is to use <a href="https://crane.dev/" rel="nofollow">crane</a>. The beauty of crane is that it allows you to build your rust dependencies just once and then lint, build, and test changes to your project without slowing down. This is something more related to Github Actions, but you might also take advantage of this in the prebuild process within the Dev Container.</p></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-20b5c03 elementor-widget elementor-widget-heading" data-id="20b5c03" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trick #6: Leverage the power of vscode
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-d3e4697 elementor-widget elementor-widget-text-editor" data-id="d3e4697" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="highlight highlight-source-nix" dir="auto"><p dir="auto">You can use all kinds of VS Code stuff within Dev Containers, and everyone will benefit from the time each other spends in having a top-notch development environment configuration. It’s multiplicative. Here are some examples:</p><ul dir="auto"><li>You can configure the editor settings in <code>.vscode/settings.json</code>. If your project is using 80 character lines, maybe you want to add a ruler with <code>"editor.rulers": [80],</code>. This makes the policy clear for the whole development team.</li><li>You can <a href="https://github.com/sequentech/bulletin-board/blob/main/.devcontainer/devcontainer.json#L27">setup preinstalled vscode extensions in <code>.devcontainer/devcontainer.json</code></a>.</li><li>You can configure your project <a href="https://github.com/sequentech/bulletin-board/blob/main/.vscode/launch.json">debugging settings in <code>.vscode/launch.json</code></a>.</li><li>You can configure some <a href="https://code.visualstudio.com/docs/editor/tasks" rel="nofollow">typical tasks</a> like running the unit tests, running the server backend or applying the linter with <a href="https://github.com/sequentech/bulletin-board/blob/main/.vscode/tasks.json"><code>.vscode/tasks.json</code></a>.</li></ul><p dir="auto">As we said earlier: anyone can improve the development environment configuration and everyone benefits. </p></div></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-b728c97 elementor-widget elementor-widget-heading" data-id="b728c97" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trick #7: Going multi-repo
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-c9dbdb0 elementor-widget elementor-widget-text-editor" data-id="c9dbdb0" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="highlight highlight-source-nix" dir="auto"><div class="elementor-element elementor-element-ce09b10 elementor-widget elementor-widget-text-editor" data-id="ce09b10" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><p dir="auto">Google famously uses a single <a href="https://en.wikipedia.org/wiki/Monorepo" rel="nofollow">monorepo architecture</a>. However, in open source typically you don’t. Typically you have multiple repositories to make it easy to let other people collaborate and reuse specific projects. Sequent Voting Platform is open source not only by license but we also buy the philosophy of collaboration, so we are multi-repo.</p><p dir="auto">However, it can be challenging to manage multiple repositories during development. For example, recently I was developing the <a href="https://github.com/sequentech/bulletin-board">bulletin-board</a> using Dev Containers and I needed, for this feature I was coding, to also apply some minor code changes to one of the dependencies of the bulletin-board, <a href="https://github.com/sequentech/strand">strand</a>.</p><p dir="auto">Should I spin two different codespaces for that? What if I need to touch code in multiple dependencies? Well, don’t worry too much because yet again, Dev Containers and codespaces have a solution for that.</p><p dir="auto">First, you can configure the <code>devcontainer.json</code> to give git commit permissions to other repositories of the same organizations <a href="https://github.com/sequentech/bulletin-board/blob/main/.devcontainer/devcontainer.json#L20">like we do here</a>. More details in <a href="https://docs.github.com/en/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces#setting-additional-repository-permissions">the documentation</a>.</p><p dir="auto">Second, you can modify your <code>onCreateCommand</code> script to download this and any other dependency locally (just do a <code>git clone</code>).</p><p dir="auto">Third, use this local dependency. How to do this will depend on your toolchain. If you are using Rust, my advice is: don’t touch <code>Cargo.toml</code>. Yes, one quick and dirty option is to change your dependency from something like, maybe:</p></div></div></div></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-02019fd elementor-widget elementor-widget-code-highlight" data-id="02019fd" data-element_type="widget" data-widget_type="code-highlight.default">
				<div class="elementor-widget-container">
					<div class="prismjs-default copy-to-clipboard ">
			<pre data-line="" class="highlight-height language-javascript line-numbers">
				<code readonly="true" class="language-javascript">
					<xmp>strand = { git = "https://github.com/sequentech/strand", features= ["rayon"] }
</xmp>
				</code>
			</pre>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-914cd66 elementor-widget elementor-widget-text-editor" data-id="914cd66" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="highlight highlight-source-nix" dir="auto"><div class="elementor-element elementor-element-ce09b10 elementor-widget elementor-widget-text-editor" data-id="ce09b10" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><p dir="auto">to:</p></div></div></div></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-4d2e10d elementor-widget elementor-widget-code-highlight" data-id="4d2e10d" data-element_type="widget" data-widget_type="code-highlight.default">
				<div class="elementor-widget-container">
					<div class="prismjs-default copy-to-clipboard ">
			<pre data-line="" class="highlight-height language-javascript line-numbers">
				<code readonly="true" class="language-javascript">
					<xmp>strand = { path="./strand", features=["rayon"] }
</xmp>
				</code>
			</pre>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-96c9bd9 elementor-widget elementor-widget-text-editor" data-id="96c9bd9" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="highlight highlight-source-nix" dir="auto"><div class="elementor-element elementor-element-ce09b10 elementor-widget elementor-widget-text-editor" data-id="ce09b10" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="elementor-element elementor-element-619d5b3 elementor-widget elementor-widget-text-editor" data-id="619d5b3" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div dir="auto"><p dir="auto">But then you might end up committing that change in  <code>Cargo.toml</code>.and that just isn’t good <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" />.</p><p dir="auto">Instead, you should create a new file to override dependencies called <code>.cargo/config.toml</code>, and add there something like:</p></div></div></div></div></div></div></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-8459d29 elementor-widget elementor-widget-code-highlight" data-id="8459d29" data-element_type="widget" data-widget_type="code-highlight.default">
				<div class="elementor-widget-container">
					<div class="prismjs-default copy-to-clipboard ">
			<pre data-line="" class="highlight-height language-javascript line-numbers">
				<code readonly="true" class="language-javascript">
					<xmp>[patch.'https://github.com/sequentech/strand']
strand = { path = "strand", features= ["rayon"] }
</xmp>
				</code>
			</pre>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-ee99569 elementor-widget elementor-widget-text-editor" data-id="ee99569" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="highlight highlight-source-nix" dir="auto"><div class="elementor-element elementor-element-ce09b10 elementor-widget elementor-widget-text-editor" data-id="ce09b10" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="elementor-element elementor-element-619d5b3 elementor-widget elementor-widget-text-editor" data-id="619d5b3" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div dir="auto"><div dir="auto">Additionally, add the <code>.cargo/config.toml</code> to <code>.gitignore</code> to ensure you don’t inadvertently commit this file.</div></div></div></div></div></div></div></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-147d25f elementor-widget elementor-widget-heading" data-id="147d25f" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trick #8: Use multiple containers with docker compose</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-ecd35c7 elementor-widget elementor-widget-text-editor" data-id="ecd35c7" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="highlight highlight-source-nix" dir="auto"><div class="elementor-element elementor-element-ce09b10 elementor-widget elementor-widget-text-editor" data-id="ce09b10" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="elementor-element elementor-element-619d5b3 elementor-widget elementor-widget-text-editor" data-id="619d5b3" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div dir="auto"><div dir="auto"><p dir="auto">Maybe you are developing a backend service and you need to use a PostgreSQL database to run it. Or maybe you want to be able to run both the frontend and the backend within your development environment. Or.. you get the point.</p><p dir="auto">You can orchestrate the launch of multiple containers with <a href="https://code.visualstudio.com/docs/devcontainers/create-dev-container#_use-docker-compose" rel="nofollow">docker compose</a>. Because why not, it’s more flexible to always configure your <code>devcontainer.json</code> using docker compose.</p></div></div></div></div></div></div></div></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-aee4d38 elementor-widget elementor-widget-heading" data-id="aee4d38" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trick #9: Multiple Dev Container configurations
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-66c812e elementor-widget elementor-widget-text-editor" data-id="66c812e" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="highlight highlight-source-nix" dir="auto"><div class="elementor-element elementor-element-ce09b10 elementor-widget elementor-widget-text-editor" data-id="ce09b10" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="elementor-element elementor-element-619d5b3 elementor-widget elementor-widget-text-editor" data-id="619d5b3" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div dir="auto"><div dir="auto"><p dir="auto">Contemplate these cases:</p><ul dir="auto"><li>There are times you need to work with a local copy of dependencies, there are others you don’t.</li><li>There are some times where you broke your prebuilds and you want to launch a new Dev Container with no setup script.</li><li>Maybe sometimes you want to develop with an environment using PostgreSQL as a database backend and others with MariaDB.</li><li>Or maybe you actually have multiple projects within a single repository and you want to be able to have a ready-to-go Dev container for each of them (Hello there monorepo people!).</li></ul><p dir="auto">All this can be solved using <a href="https://containers.dev/implementors/spec/#devcontainerjson" rel="nofollow">multiple Dev Container configurations</a>. You can have multiple, ready-to-go <code>devcontainer.json</code> files inside the <code>.devcontainer</code> directory, using the pattern <code>.devcontainer/{name}/devcontainer.json</code>. And <a href="https://containers.dev/implementors/spec/#devcontainerjson" rel="nofollow">Codespaces also supports this feature natively</a>.</p><p dir="auto">Remember these tricks are composable. For example, in this case you can configure prebuilds for each Dev Container configuration.</p></div></div></div></div></div></div></div></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-bd7f030 elementor-widget elementor-widget-heading" data-id="bd7f030" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trick #10: Custom codespaces
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-7ae43c5 elementor-widget elementor-widget-text-editor" data-id="7ae43c5" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="highlight highlight-source-nix" dir="auto"><div class="elementor-element elementor-element-ce09b10 elementor-widget elementor-widget-text-editor" data-id="ce09b10" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="elementor-element elementor-element-619d5b3 elementor-widget elementor-widget-text-editor" data-id="619d5b3" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div dir="auto"><div dir="auto"><p dir="auto">In Github Codespaces you can use the <a href="https://github.blog/2022-04-20-codespaces-multi-repository-monorepo-scenarios/#advanced-create" rel="nofollow">Advance Create feature</a> to configure in more detail your new codespace: choose the specific branch, the number of cores or amount of RAM of the container, the Dev Container file, and actually it has a nice interface to just modify manually the <code>devcontainer.json</code> before launching. This can be helpful in disaster recovery scenarios, for example in broken configurations you can edit the <code>onCreateCommand</code> or anything else.</p></div></div></div></div></div></div></div></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-c7a5b40 elementor-widget elementor-widget-heading" data-id="c7a5b40" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trick #11: Garbage collection
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-4515ef5 elementor-widget elementor-widget-text-editor" data-id="4515ef5" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="highlight highlight-source-nix" dir="auto"><div class="elementor-element elementor-element-ce09b10 elementor-widget elementor-widget-text-editor" data-id="ce09b10" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="elementor-element elementor-element-619d5b3 elementor-widget elementor-widget-text-editor" data-id="619d5b3" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div dir="auto"><div dir="auto"><p dir="auto">Dev containers are typically launched with a specific disk size. Sometimes this turns out not to be enough. Now imagine you have uncommitted/unpushed changes in the container. There are multiple things you can do:</p><ul dir="auto"><li>If the problem is that Nix is using too much space, try running <a href="https://nixos.org/guides/nix-pills/garbage-collector.html" rel="nofollow"><code>nix-collect-garbage</code></a>.</li><li>You can use the Github Codespaces UI to <a href="https://docs.github.com/en/codespaces/troubleshooting/exporting-changes-to-a-branch">export changes to a branch</a>.</li></ul><p dir="auto">Oh and now that we are talking about garbage collection: you can also review and manage all the codespaces you personally have in <a href="https://github.com/codespaces">github.com/codespaces</a>. When working with multiple repository, with multiple features or branches, you might forget about some codespaces.</p><p dir="auto">Codespaces typically <a href="https://docs.github.com/en/codespaces/customizing-your-codespace/setting-your-timeout-period-for-github-codespaces">auto-stop after idling for 30 minutes</a> – and of course this is configurable. But they are still wasting/spending disk space. So go to <a href="https://github.com/codespaces">github.com/codespaces</a> and delete all your unneeded codespaces.</p></div></div></div></div></div></div></div></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-4d18077 elementor-widget elementor-widget-heading" data-id="4d18077" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trick #12: Codespaces vscode plugin
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-cc57df8 elementor-widget elementor-widget-text-editor" data-id="cc57df8" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="highlight highlight-source-nix" dir="auto"><div class="elementor-element elementor-element-ce09b10 elementor-widget elementor-widget-text-editor" data-id="ce09b10" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="elementor-element elementor-element-619d5b3 elementor-widget elementor-widget-text-editor" data-id="619d5b3" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div dir="auto"><div dir="auto"><p dir="auto">So you can go to your repo in github.com, click on the big green button (<code>Code</code>) and launch a new codespace right there and it will open the codespace in vscode running within the web browser in a new tab.</p><p dir="auto">But it doesn’t stop there. You can perhaps close that tab, and then click again in that green button, see there listed your just-created codespace, click on the <code>...</code> button -&gt; <code>Open in..</code> -&gt; <code>Open in Visual Studio Code</code>. And if your local vscode installation has the <a href="https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces" rel="nofollow">Codespaces extension</a> it will just open in a new window of your vscode.</p><p dir="auto">You can even forget altogether about the web browser and do the whole thing from within vscode. With <code>Cmd + Shift + P</code> search for <code>Codespaces</code> and from there you can: connect to a codespace, stop a codespace, rebuild it, create a new one from a specific repository.. you name it.</p></div></div></div></div></div></div></div></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-984e234 elementor-widget elementor-widget-heading" data-id="984e234" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Wrapping up
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-a2aa0be elementor-widget elementor-widget-text-editor" data-id="a2aa0be" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="highlight highlight-source-nix" dir="auto"><div class="elementor-element elementor-element-ce09b10 elementor-widget elementor-widget-text-editor" data-id="ce09b10" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div class="elementor-element elementor-element-619d5b3 elementor-widget elementor-widget-text-editor" data-id="619d5b3" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><div dir="auto"><div dir="auto"><p dir="auto">There are other avenues to explore in the future. For example, <a href="https://devenv.sh/integrations/codespaces-devcontainer/" rel="nofollow">denvenv.sh</a> also supports integration with Dev Containers and they surely also integrates well with cachix since it comes from the same developer.</p><p dir="auto">Another trick we have not explored yet is to use <a href="https://containers.dev/implementors/features/" rel="nofollow">Dev Container Features</a> to package (quote) “self-contained, shareable units of installation code and development container configuration”.</p><p dir="auto">We’ll continue our road to making development easier and keep you updated.</p></div></div></div></div></div></div></div></div></div>						</div>
				</div>
				</div>
					</div>
				</div>
				</div>
		<p>The post <a href="/tech/a-bag-of-dev-container-tricks/">A bag of Dev Container Tricks</a> appeared first on <a href="/">Sequent</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Calling Go Code From Rust: A Google Trillian Story</title>
		<link>/tech/calling-go-code-from-rust-a-google-trillian-story/</link>
		
		<dc:creator><![CDATA[Serhii Bohynia]]></dc:creator>
		<pubDate>Sun, 22 Jan 2023 05:32:34 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[blog]]></category>
		<guid isPermaLink="false">/?p=1979</guid>

					<description><![CDATA[<p>Although we have not officially announced any specific plan, it’s not a secret that at Sequent we’re developing our 2nd generation secure voting platform, because we work out there in the open. Go Back Blog Add a header to begin generating the table of contents The bulletin board and its requirements Although we have not officially [&#8230;]</p>
<p>The post <a href="/tech/calling-go-code-from-rust-a-google-trillian-story/">Calling Go Code From Rust: A Google Trillian Story</a> appeared first on <a href="/">Sequent</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="1979" class="elementor elementor-1979" data-elementor-post-type="post">
				<div class="elementor-element elementor-element-2d77ab4a e-flex e-con-boxed e-con e-parent" data-id="2d77ab4a" data-element_type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-297e0a57 elementor-widget elementor-widget-text-editor" data-id="297e0a57" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Although we have not officially announced any specific plan, it’s not a secret that at Sequent we’re developing our 2nd generation secure voting platform, because <a href="http://github.com/sequentech/">we work out there in the open</a>.</p>						</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-6d3fcb8e e-flex e-con-boxed e-con e-parent" data-id="6d3fcb8e" data-element_type="container" data-settings="{&quot;background_background&quot;:&quot;classic&quot;}">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-4ec283d4 e-con-full e-flex elementor-invisible e-con e-child" data-id="4ec283d4" data-element_type="container" data-settings="{&quot;animation&quot;:&quot;fadeInLeft&quot;}">
				<div class="elementor-element elementor-element-2d2a5ed4 elementor-widget elementor-widget-button" data-id="2d2a5ed4" data-element_type="widget" data-widget_type="button.default">
				<div class="elementor-widget-container">
					<div class="elementor-button-wrapper">
			<a class="elementor-button elementor-button-link elementor-size-sm" href="/blog/">
						<span class="elementor-button-content-wrapper">
						<span class="elementor-button-icon elementor-align-icon-left">
				<i aria-hidden="true" class="fas fa-angle-left"></i>			</span>
									<span class="elementor-button-text">Go Back</span>
					</span>
					</a>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-7a528e9a elementor-widget elementor-widget-heading" data-id="7a528e9a" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<div class="elementor-heading-title elementor-size-default">Blog</div>		</div>
				</div>
				<div class="elementor-element elementor-element-2fe7206f elementor-widget__width-inherit elementor-widget elementor-widget-theme-post-title elementor-page-title elementor-widget-heading" data-id="2fe7206f" data-element_type="widget" data-widget_type="theme-post-title.default">
				<div class="elementor-widget-container">
			<h1 class="elementor-heading-title elementor-size-default">Calling Go Code From Rust: A Google Trillian Story</h1>		</div>
				</div>
				<div class="elementor-element elementor-element-4f27bb27 elementor-widget elementor-widget-text-editor" data-id="4f27bb27" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<span>Blog</span>, <span>Technology</span>						</div>
				</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-13c54f26 e-flex e-con-boxed e-con e-parent" data-id="13c54f26" data-element_type="container">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-5c7157eb e-con-full e-flex e-con e-child" data-id="5c7157eb" data-element_type="container">
				<div class="elementor-element elementor-element-675e170a uael-heading-align-left elementor-widget elementor-widget-uael-table-of-contents" data-id="675e170a" data-element_type="widget" data-settings="{&quot;heading_bottom_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:0,&quot;sizes&quot;:[]},&quot;content_between_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:16,&quot;sizes&quot;:[]},&quot;sticky&quot;:&quot;top&quot;,&quot;sticky_on&quot;:[&quot;desktop&quot;,&quot;tablet&quot;],&quot;scroll_offset&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;scroll_offset_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;scroll_offset_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;heading_text_align&quot;:&quot;left&quot;,&quot;heading_bottom_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;heading_bottom_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;content_between_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;content_between_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;sticky_offset&quot;:0,&quot;sticky_effects_offset&quot;:0}" data-widget_type="uael-table-of-contents.default">
				<div class="elementor-widget-container">
					<div class="uael-toc-main-wrapper" data-headings="h2,h3" >
			<div class="uael-toc-wrapper">
				<div class="uael-toc-header">
					<span class="uael-toc-heading elementor-inline-editing" data-elementor-setting-key="heading_title" data-elementor-inline-editing-toolbar="basic" ></span>
									</div>
								<div class="uael-toc-toggle-content">
					<div class="uael-toc-content-wrapper">
						
							<ul data-toc-headings="headings" class="uael-toc-list uael-toc-list-none" data-scroll="500" ></ul>
											</div>
				</div>
				<div class="uael-toc-empty-note">
					<span>Add a header to begin generating the table of contents</span>
				</div>
			</div>
					</div>
				</div>
				</div>
				</div>
		<div class="elementor-element elementor-element-6c496f9a e-con-full e-flex e-con e-child" data-id="6c496f9a" data-element_type="container">
				<div class="elementor-element elementor-element-dbdec27 elementor-widget elementor-widget-image" data-id="dbdec27" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img decoding="async" width="768" height="403" src="/wp-content/uploads/2024/03/3-1-768x403-1.png" class="attachment-full size-full wp-image-1980" alt="" srcset="/wp-content/uploads/2024/03/3-1-768x403-1.png 768w, /wp-content/uploads/2024/03/3-1-768x403-1-300x157.png 300w" sizes="(max-width: 768px) 100vw, 768px" />													</div>
				</div>
				<div class="elementor-element elementor-element-4c2c29d elementor-widget elementor-widget-heading" data-id="4c2c29d" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">The bulletin board and its requirements
</h2>		</div>
				</div>
		<div class="elementor-element elementor-element-68d829b3 e-flex e-con-boxed e-con e-child" data-id="68d829b3" data-element_type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-3abdbbdc elementor-widget elementor-widget-text-editor" data-id="3abdbbdc" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">Although we have not officially announced any specific plan, it’s not a secret that at Sequent we’re developing our 2nd generation secure voting platform, because <a href="http://github.com/sequentech/">we work out there in the open</a>.</p><p dir="auto">One of the most critical pieces of our 2nd-gen platform will be the <a href="http://github.com/sequentech/bulletin-board">bulletin board</a>. In voting systems’ jargon, the bulletin board is a broadcast channel with memory that stores relevant election information such as cast votes, public keys and election results.</p><p dir="auto">What follows is a non-exhaustive list of the requirements we have for the bulletin board:</p><ol dir="auto"><li>Verifiability: It is <strong>tamper-evident append-only log</strong>. Added entries cannot be removed or modified, and this should be verifiable by third parties for transparency.</li><li><u>Authenticity</u>: All posts to the bulletin board must be authenticated, in this case with digital signatures.</li><li>Performance: It supports adding <strong>multi-gigabyte entries</strong>. Intermediate steps of the <a href="https://github.com/sequentech/braid">mixnet</a> <a href="https://sequentech.io/wp-content/uploads/2023/01/2021-09-22-proto-2-Sequent-Cryptographic-Protocol.pdf" rel="nofollow">cryptographic protocol</a> might include millions of votes. That’s gigabytes worth of data.</li><li>Performance: <strong>scales to +1K votes/second</strong>. A must for elections with hundreds of thousands or millions of voters. We want to store votes in the board while people are voting, to increase verifiability.</li><li>Storage: Board can be <strong>archived/retrieved as files</strong>. We want to be able to persist data easily using AWS S3 or similar. A board client should be able to use this bulletin board in read-only mode without having any other backend service running. Anyone should also be able to download easily the board a local copy and work transparently from it.</li><li>Compliance: <strong>Supports filtering entry data</strong> for <a href="https://gdpr-info.eu/art-17-gdpr/" rel="nofollow">compliance reasons like the right to be forgotten in GDPR</a> without compromising other requirements, in particular the verifiability of the tamper-evident log.</li><li>Language: <strong>Rust development</strong> – it’s the language we have chosen for our 2nd-gen platform.</li></ol><p dir="auto">This is a hard nut to crack with conflicting requirements. That’s one of the wonderful aspects of voting technology: working in challenging problems.</p><p dir="auto">We could debate what is the right technology to implement a bulletin board. There are different approaches others have tried, ranging from trying to use Ethereum or any other blockchain, using git as a simple and well-known hash-chain or perhaps using a database like PostgreSQL as the backend storage. None of those provide a satisfactory level of compliance with the requirements previously outlined. That might be the topic of some other post.</p><p dir="auto">We settled to use a <a href="https://github.com/google/trillian-examples/tree/master/serverless">serverless</a> <a href="https://github.com/google/trillian">Google Trillian</a>-based log. Which brings us to..</p>						</div>
				</div>
				<div class="elementor-element elementor-element-b6ee3c1 elementor-widget elementor-widget-heading" data-id="b6ee3c1" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">What is Google Trillian?
</h2>		</div>
				</div>
					</div>
				</div>
				<div class="elementor-element elementor-element-598c3e90 elementor-widget elementor-widget-text-editor" data-id="598c3e90" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">Long story short, Trillian is a tamper-evident log. Its <a href="https://github.com/google/trillian">github repository</a> description is <i>“A transparent, highly scalable and cryptographically verifiable data store.”</i> Trillian is written in Go Language, and it allows to register entries in a log that other can query, monitor and request inclusion of new entries. It’s transparent and tamper-evident because it stores the log using a <a href="https://en.wikipedia.org/wiki/Merkle_tree" rel="nofollow">Merkle Tree</a>, which is just a tree of hashes of data where the leaves are the entries, and it allows to efficiently add entries, verify entries order and inclusion, and compare an evolving tree of entries and see that two different tree snapshots are consistent, i.e. older entries are still there in the expected location.</p><p dir="auto">Google developed Trillian as a generic implementation of <a href="https://certificate.transparency.dev/" rel="nofollow">Certificate Transparency</a> (CT). If you are reading this blog post, you are using Certificate Transparency. Your web browser and millions of other web browsers use CT to verify that the digital certificate of any website using https have been logged in a publicly available and verifiable trillian-based log. The idea is that the browser will only accept certificates that everyone knows about because they are publicly logged. CT has 8.4B certificates logged so far. And counting. Cool technology indeed.</p><p dir="auto">As mentioned earlier, Google Trillian is just the generic implementation of CT, allowing to log any kind of entries, not just digital certificates. In our case, we will log election data.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-85a5d68 elementor-widget elementor-widget-heading" data-id="85a5d68" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Trillian serverless
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-51bf4031 elementor-widget elementor-widget-text-editor" data-id="51bf4031" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">We cannot use Google Trillian simply as a service, because it doesn’t comply with our requirements: it’s not performant enough either in the size of entries (doesn’t support multi-gigabyte entries) not in terms of speed (with MySQL it handles ~10-20 new entries per second). Also, the storage backend is typically mysql and to access the data, you need the trillian service running. </p><p dir="auto">We’ll be using trillian serverless instead. Instead of using Trillian as a service, we would be using some of the Trillian library code to create our own log. Trillian Serverless (TS) stores <a href="https://github.com/google/trillian-examples/tree/master/serverless/api/layout">everything as files</a>, and any client can just access the log this way – no need for a running backend server, other than a generic file server like AWS S3 or even Github Pages. Each entry will be stored as a file along with a set of tiles that represents the hash tree (Merkle Tree) of the log. Entries can easily be sized in gigabytes, and well, for small entries it’s performant enough as we will see. </p><p dir="auto">A small note about compliance and the right to be forgotten: if for any reason a specific entry needs to be password-protected or just not publicly available anymore, having a hash tree (Merkle Tree) with entries being the leaves of that tree and represented as files allows for checking consistency of the log, even inclusion of a specific entry, even when a specific entry data file is not publicly available anymore. This feature is not implemented yet though.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-a755cf2 elementor-widget elementor-widget-heading" data-id="a755cf2" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">C FFI, the gold standard in interoperability
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-7a681ab0 elementor-widget elementor-widget-text-editor" data-id="7a681ab0" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">At this point we know that we are implementing our Bulletin Board using Rust, but we will be calling a library written in Go. Rust has different kind of data structures than Go. Even though both are compiled and feature strong typing, Go uses a Garbage Collector for dynamically allocating and managing the lifetime of objects in the heap, while Rust uses ownership, the type system and the borrow checker instead. Is this even.. possible?</p><p dir="auto">Turns out it is. The reason is both can talk to each other using a common lower denominator: the C <a href="https://en.wikipedia.org/wiki/Foreign_function_interface" rel="nofollow">Foreign Function Interface (FFI)</a>, which is (excerpt from Wikipedia): <i>“A mechanism by which a program written in one programming language can call routines or make use of services written in another.”</i></p><p dir="auto">What we intend to do is to end up with a compiled binary, which is our bulletin board service implemented in Rust, that will include a statically linked Go library that provides a C-FFI interface. The binary will depend on little more than libc.</p><p dir="auto">For implementation purposes, we will be needing to understand how to translate in and out from and to C FFI both in Rust and Go. The way a function call from Rust to Go will usually happen is:</p><ol dir="auto"><li><strong>Rust function</strong>: We have some Rust code that needs to call the functionality provided by Go. We call the Rust wrapper function that provides access to that functionality.</li><li><strong>Rust Wrapper function</strong>: Our Rust wrapper function converts Rust data structures to data structures that can be managed and understood by the C FFI. After conversion, this wrapper will call a C FFI function provided by our static Go library.</li><li><strong>Go Wrapper function</strong>: Our Go wrapper function provides an interface for that C FFI function, and this Go function receives the call from previous step. The first thing this wrapper function does is converting the input data to data structures managed by Go and easy to work with in Go, and then starts working with this input data.</li><li><strong>Go function</strong>: Our Go function calls whatever Go functions with the input data (in our case, from Trillian) obtaining some data that needs to be returned, and returns this to the Go wrapper function.</li><li><strong>Go Wrapper function</strong>: Our Go wrapper code converts these Go output data structures to something that can be returned through the C FFI interface.</li><li><strong>Rust Wrapper function</strong>: The output data is received by the Rust wrapper code and is converted into Rusty data structures.</li><li><strong>Rust function</strong>: The Rust wrapper code returns to the initial Rust function that uses this output data and goes on with life.</li></ol>						</div>
				</div>
				<div class="elementor-element elementor-element-1d7d9f0 elementor-widget elementor-widget-heading" data-id="1d7d9f0" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">How to actually do this?
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-6f1a07a6 elementor-widget elementor-widget-text-editor" data-id="6f1a07a6" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">If you need to call Go code from Rust, unfortunately there’s not much documentation out there and what you can find is quite scattered along the tubes. Here is a bunch of references that I found useful:</p><ul dir="auto"><li><a href="https://go.dev/blog/cgo" rel="nofollow">https://go.dev/blog/cgo</a></li><li><a href="https://pkg.go.dev/cmd/cgo" rel="nofollow">https://pkg.go.dev/cmd/cgo</a></li><li><a href="https://pkg.go.dev/unsafe#Slice" rel="nofollow">https://pkg.go.dev/unsafe#Slice</a></li><li><a href="https://belski.me/blog/foreign-function-interface-in-rust-and-go/" rel="nofollow">https://belski.me/blog/foreign-function-interface-in-rust-and-go/</a></li><li><a href="https://doc.rust-lang.org/nomicon/ffi.html" rel="nofollow">https://doc.rust-lang.org/nomicon/ffi.html</a></li><li><a href="https://users.rust-lang.org/t/preparing-an-array-of-structs-for-ffi/33411" rel="nofollow">https://users.rust-lang.org/t/preparing-an-array-of-structs-for-ffi/33411</a></li></ul><p dir="auto"><br />Since our project includes some other advanced techniques like passing structs from Rust to Go and back, you might also be interested in just taking a look at our <a href="https://github.com/sequentech/bulletin-board/">bulletin board</a>.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-4322ac6 elementor-widget elementor-widget-heading" data-id="4322ac6" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">How to actually do this?
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-3668bb8 elementor-widget elementor-widget-text-editor" data-id="3668bb8" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">This is becoming a bit of a long post, so we will mention a couple of the interesting bits which might not be particularly well documented and I found particularly interesting:</p>						</div>
				</div>
				<div class="elementor-element elementor-element-5af1c66f elementor-widget elementor-widget-heading" data-id="5af1c66f" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">Integrated builds of Go and Rust
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-26351e46 elementor-widget elementor-widget-text-editor" data-id="26351e46" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div class="elementor-element elementor-element-fa3ef44 elementor-widget elementor-widget-text-editor" data-id="fa3ef44" data-element_type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><p dir="auto">One of the most annoying things during this endeavour is the manual work of just building. How do you approach build both? Do you create a distinct package for the Go code? While changing both Go and Rust code, do you always manually first compile the Go code and then build with <code>cargo build</code>?</p><p dir="auto">Our approach was: <strong>build Go code automatically, from cargo</strong>. You can do this using the <a href="https://doc.rust-lang.org/cargo/reference/build-scripts.html" rel="nofollow">build scripts</a> through <code>build.rs</code>.</p></div></div>						</div>
				</div>
				<div class="elementor-element elementor-element-a66f0e9 elementor-widget elementor-widget-code-highlight" data-id="a66f0e9" data-element_type="widget" data-widget_type="code-highlight.default">
				<div class="elementor-widget-container">
					<div class="prismjs-default copy-to-clipboard ">
			<pre data-line="" class="highlight-height language-rust line-numbers">
				<code readonly="true" class="language-rust">
					<xmp>fn main() {
    // Instruct cargo that if these files change, it needs to
    // rerun this script
    println!("cargo:rerun-if-changed=trillian-board/main.go");
    println!("cargo:rerun-if-changed=trillian-board/go.sum");

    // Build the go static library
    run_command(vec![
        "go", "build", "-buildmode=c-archive",
        "-o", "libtrillian_board.a", "main.go"
    ], cwd="./trillian-board/");

    // Instruct cargo to statically link to the just-build
    // static library `libtrillian_board.a`
    println!("cargo:rustc-link-lib=static=trillian_board");
}</xmp>
				</code>
			</pre>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-dcd9d71 elementor-widget elementor-widget-text-editor" data-id="dcd9d71" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">Note that this is just some sample Rust pseudo-code. For the real life nitty-gritty details, take a look at our actual <a href="https://github.com/sequentech/bulletin-board/blob/main/build.rs"><code>build.rs</code> file</a> in <a href="https://github.com/sequentech/bulletin-board/">sequentech/bulletin-board</a> repository.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-29365cc2 elementor-widget elementor-widget-heading" data-id="29365cc2" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">Performantly passing big data arrays from Rust to Go
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-3a8b37f8 elementor-widget elementor-widget-text-editor" data-id="3a8b37f8" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">After looking at the 6 steps of calling Go code from Rust, it’s difficult not to have concerns about performance when having so many intermediate steps just to do a simple function call. The real truth is that obviously performance is not as good as just using Rust code, but on the other hand in some cases it’s not as bad as it looks.</p><p dir="auto">When creating new entries, we need to pass the entry data (remember, potentially gigabytes of information) to the Go code. In our current work-in-progress version of the system, we do all that with heap-allocated Rust array.</p><p dir="auto"><a href="https://users.rust-lang.org/t/preparing-an-array-of-structs-for-ffi/33411/2" rel="nofollow">Following a suggestion in Stack Overflow</a>, we found a way to convert a Rust Array to a C FFI owned array:</p>						</div>
				</div>
				<div class="elementor-element elementor-element-94b1ce4 elementor-widget elementor-widget-code-highlight" data-id="94b1ce4" data-element_type="widget" data-widget_type="code-highlight.default">
				<div class="elementor-widget-container">
					<div class="prismjs-default copy-to-clipboard ">
			<pre data-line="" class="highlight-height language-rust line-numbers">
				<code readonly="true" class="language-rust">
					<xmp>fn vec_to_cffi_array<t>(input: Vec<t>) -> (*mut T, usize) {
    let boxed_slice: Box = input.into_boxed_slice();
    let length = boxed_slice.len();
    let fat_ptr: *mut [T] = Box::into_raw(boxed_slice);
    let slim_ptr: *mut T = fat_ptr as _;
    return (slim_ptr, length);
}</t></t></xmp>
				</code>
			</pre>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-dd32b66 elementor-widget elementor-widget-text-editor" data-id="dd32b66" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">Apart from allocating a variable holding the length of the array as part of the returning tuple, there’s no extra memory allocation – we are just dancing with the type system, but in the end we simply convert the <code>Vec&lt;T&gt;</code> into a pointer. The receiver will now be in charge of managing the allocated memory though. More on that later.</p><p dir="auto">BTW we also needed the <a href="https://github.com/sequentech/bulletin-board/blob/main/src/backend_trillian.rs#L230">reverse function (from C FFI Array to rust)</a>: also possible with no big memory allocations.</p><p dir="auto">How to use this data array in Go? Well, that turned out to be easy. Just use <a href="https://pkg.go.dev/unsafe#Slice" rel="nofollow"><code>unsafe.Slice</code></a>, <a href="https://github.com/sequentech/bulletin-board/blob/main/trillian-board/main.go#L242">like we do</a>:</p>						</div>
				</div>
				<div class="elementor-element elementor-element-816baca elementor-widget elementor-widget-code-highlight" data-id="816baca" data-element_type="widget" data-widget_type="code-highlight.default">
				<div class="elementor-widget-container">
					<div class="prismjs-default copy-to-clipboard ">
			<pre data-line="" class="highlight-height language-rust line-numbers">
				<code readonly="true" class="language-rust">
					<xmp>entries := unsafe.Slice(entriesC, numEntries)
</xmp>
				</code>
			</pre>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-e951803 elementor-widget elementor-widget-text-editor" data-id="e951803" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">This code allows Go access the array as a <code>Slice</code> through the <code>entries</code> variable, indicating to Go that this is memory that the Go Garbage Collector does not need to manage itself. So at this point you need to remember to free the memory to avoid memory leaks. You can do that in Rust side or in Go side. We decided to go the rusty path, using a function like follows:</p>						</div>
				</div>
				<div class="elementor-element elementor-element-f9c98d2 elementor-widget elementor-widget-code-highlight" data-id="f9c98d2" data-element_type="widget" data-widget_type="code-highlight.default">
				<div class="elementor-widget-container">
					<div class="prismjs-default copy-to-clipboard ">
			<pre data-line="" class="highlight-height language-rust line-numbers">
				<code readonly="true" class="language-rust">
					<xmp>fn free_vec<t>(ptr: *mut T, len: usize) {
    if ptr.is_null() {
        eprintln!("free_vec() errored: got NULL ptr!");
        ::std::process::abort();
    }
    let entries = unsafe { slice::from_raw_parts_mut(ptr, len) };
    drop(unsafe { Box::from_raw(entries) });
}</t></xmp>
				</code>
			</pre>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-62a2572 elementor-widget elementor-widget-text-editor" data-id="62a2572" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">The performance we get is pretty decent when adding entries to this trillian-based log. For small entries, we achieve more than a 1,000 separate inserts per second (sequence+integrate in Trillian terminology). That’s about 2 orders of magnitude more than the ordinary Trillian service that uses MySQL. Without any further optimization. Screenshot from our benchmark:</p>						</div>
				</div>
				<div class="elementor-element elementor-element-5459f07 elementor-widget elementor-widget-image" data-id="5459f07" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="800" height="253" src="/wp-content/uploads/2024/03/bench-1536x486-1-1024x324.png" class="attachment-large size-large wp-image-1983" alt="" srcset="/wp-content/uploads/2024/03/bench-1536x486-1-1024x324.png 1024w, /wp-content/uploads/2024/03/bench-1536x486-1-300x95.png 300w, /wp-content/uploads/2024/03/bench-1536x486-1-768x243.png 768w, /wp-content/uploads/2024/03/bench-1536x486-1.png 1536w" sizes="(max-width: 800px) 100vw, 800px" />													</div>
				</div>
				<div class="elementor-element elementor-element-a4ec256 elementor-widget elementor-widget-heading" data-id="a4ec256" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Stay tuned
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-0a545e9 elementor-widget elementor-widget-text-editor" data-id="0a545e9" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p dir="auto">There are other interesting insights, techniques and technologies we are using in our 2nd-gen platform that we might want to talk about in the future. For example, about how we generate reproducible builds with Nix or about all the Github Actions we have on every push that include from checking license of dependencies to automatic benchmarking. Stay tuned for more to come.</p><p dir="auto">In the meantime, you can play and tinker around with our work-in-progress and yet-to-be-released open source <a href="https://github.com/sequentech/bulletin-board/">bulletin board</a> right now, because with one click you can launch a fully working development environment (the exact same one we use) by launching it with Github Codespaces. Isn’t that wonderful? It feels like magic.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-85b7ff1 elementor-widget elementor-widget-image" data-id="85b7ff1" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="800" height="445" src="/wp-content/uploads/2024/03/codespaces-1536x853-1-1024x569.png" class="attachment-large size-large wp-image-1984" alt="" srcset="/wp-content/uploads/2024/03/codespaces-1536x853-1-1024x569.png 1024w, /wp-content/uploads/2024/03/codespaces-1536x853-1-300x167.png 300w, /wp-content/uploads/2024/03/codespaces-1536x853-1-768x427.png 768w, /wp-content/uploads/2024/03/codespaces-1536x853-1.png 1536w" sizes="(max-width: 800px) 100vw, 800px" />													</div>
				</div>
				</div>
					</div>
				</div>
				</div>
		<p>The post <a href="/tech/calling-go-code-from-rust-a-google-trillian-story/">Calling Go Code From Rust: A Google Trillian Story</a> appeared first on <a href="/">Sequent</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>A Universal Approach to Election Verification: An Opportunity for Increased Trust in Elections</title>
		<link>/tech/a-universal-approach-to-election-verification-an-opportunity-for-increased-trust-in-elections/</link>
		
		<dc:creator><![CDATA[Serhii Bohynia]]></dc:creator>
		<pubDate>Wed, 14 Dec 2022 05:42:11 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[blog]]></category>
		<guid isPermaLink="false">/?p=1994</guid>

					<description><![CDATA[<p>A voting system is termed end-to-end verifiable (E2EVV) if it provides procedures to check that all steps of the voting process are executed correctly. These procedures include both human executed as well as automated software checks. Because the verifiability of end-to-end verifiable voting systems is based on mathematical proofs, the corresponding checks take the form [&#8230;]</p>
<p>The post <a href="/tech/a-universal-approach-to-election-verification-an-opportunity-for-increased-trust-in-elections/">A Universal Approach to Election Verification: An Opportunity for Increased Trust in Elections</a> appeared first on <a href="/">Sequent</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="1994" class="elementor elementor-1994" data-elementor-post-type="post">
				<div class="elementor-element elementor-element-75001990 e-flex e-con-boxed e-con e-parent" data-id="75001990" data-element_type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-54c7d920 elementor-widget elementor-widget-text-editor" data-id="54c7d920" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>A voting system is termed end-to-end verifiable (E2EVV) if it provides procedures to check that all steps of the voting process are executed correctly. These procedures include both human executed as well as automated software checks. Because the verifiability of end-to-end verifiable voting systems is based on mathematical proofs, the corresponding checks take the form of software components that mechanically verify these proofs generated by the system during a voting process.</p>						</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-6a7ccf4 e-flex e-con-boxed e-con e-parent" data-id="6a7ccf4" data-element_type="container" data-settings="{&quot;background_background&quot;:&quot;classic&quot;}">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-65851c94 e-con-full e-flex elementor-invisible e-con e-child" data-id="65851c94" data-element_type="container" data-settings="{&quot;animation&quot;:&quot;fadeInLeft&quot;}">
				<div class="elementor-element elementor-element-5331ab4b elementor-widget elementor-widget-button" data-id="5331ab4b" data-element_type="widget" data-widget_type="button.default">
				<div class="elementor-widget-container">
					<div class="elementor-button-wrapper">
			<a class="elementor-button elementor-button-link elementor-size-sm" href="/blog/">
						<span class="elementor-button-content-wrapper">
						<span class="elementor-button-icon elementor-align-icon-left">
				<i aria-hidden="true" class="fas fa-angle-left"></i>			</span>
									<span class="elementor-button-text">Go Back</span>
					</span>
					</a>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-7baed687 elementor-widget elementor-widget-heading" data-id="7baed687" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<div class="elementor-heading-title elementor-size-default">Blog</div>		</div>
				</div>
				<div class="elementor-element elementor-element-36662e5b elementor-widget__width-inherit elementor-widget elementor-widget-theme-post-title elementor-page-title elementor-widget-heading" data-id="36662e5b" data-element_type="widget" data-widget_type="theme-post-title.default">
				<div class="elementor-widget-container">
			<h1 class="elementor-heading-title elementor-size-default">A Universal Approach to Election Verification: An Opportunity for Increased Trust in Elections</h1>		</div>
				</div>
				<div class="elementor-element elementor-element-7f86b9ad elementor-widget elementor-widget-text-editor" data-id="7f86b9ad" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<span>Blog</span>, <span>Technology</span>						</div>
				</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-545cac82 e-flex e-con-boxed e-con e-parent" data-id="545cac82" data-element_type="container">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-476e8b9a e-con-full e-flex e-con e-child" data-id="476e8b9a" data-element_type="container">
				<div class="elementor-element elementor-element-1d291d9a uael-heading-align-left elementor-widget elementor-widget-uael-table-of-contents" data-id="1d291d9a" data-element_type="widget" data-settings="{&quot;heading_bottom_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:0,&quot;sizes&quot;:[]},&quot;content_between_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:16,&quot;sizes&quot;:[]},&quot;sticky&quot;:&quot;top&quot;,&quot;sticky_on&quot;:[&quot;desktop&quot;,&quot;tablet&quot;],&quot;scroll_offset&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;scroll_offset_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;scroll_offset_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;heading_text_align&quot;:&quot;left&quot;,&quot;heading_bottom_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;heading_bottom_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;content_between_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;content_between_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;sticky_offset&quot;:0,&quot;sticky_effects_offset&quot;:0}" data-widget_type="uael-table-of-contents.default">
				<div class="elementor-widget-container">
					<div class="uael-toc-main-wrapper" data-headings="h2,h3" >
			<div class="uael-toc-wrapper">
				<div class="uael-toc-header">
					<span class="uael-toc-heading elementor-inline-editing" data-elementor-setting-key="heading_title" data-elementor-inline-editing-toolbar="basic" ></span>
									</div>
								<div class="uael-toc-toggle-content">
					<div class="uael-toc-content-wrapper">
						
							<ul data-toc-headings="headings" class="uael-toc-list uael-toc-list-none" data-scroll="500" ></ul>
											</div>
				</div>
				<div class="uael-toc-empty-note">
					<span>Add a header to begin generating the table of contents</span>
				</div>
			</div>
					</div>
				</div>
				</div>
				</div>
		<div class="elementor-element elementor-element-6a76f0ea e-con-full e-flex e-con e-child" data-id="6a76f0ea" data-element_type="container">
				<div class="elementor-element elementor-element-3b83c11a elementor-widget elementor-widget-image" data-id="3b83c11a" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="768" height="403" src="/wp-content/uploads/2024/03/large-case-study-768x403-1.png" class="attachment-full size-full wp-image-1995" alt="" srcset="/wp-content/uploads/2024/03/large-case-study-768x403-1.png 768w, /wp-content/uploads/2024/03/large-case-study-768x403-1-300x157.png 300w" sizes="(max-width: 768px) 100vw, 768px" />													</div>
				</div>
				<div class="elementor-element elementor-element-54c0f14 elementor-widget elementor-widget-heading" data-id="54c0f14" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Introduction</h2>		</div>
				</div>
		<div class="elementor-element elementor-element-5ec388c8 e-flex e-con-boxed e-con e-child" data-id="5ec388c8" data-element_type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-51148090 elementor-widget elementor-widget-text-editor" data-id="51148090" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>A voting system is termed end-to-end verifiable (E2EVV) if it provides procedures to check that all steps of the voting process are executed correctly. These procedures include both human executed as well as automated software checks. Because the verifiability of end-to-end verifiable voting systems is based on mathematical proofs, the corresponding checks take the form of software components that mechanically verify these proofs generated by the system during a voting process.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-9163a20 elementor-widget elementor-widget-text-editor" data-id="9163a20" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Ideally, these verification tools, which we call verifiers, should be written independently of the system they verify, by people not associated with it. This independence, both of software as well as of people, increases the confidence in the verification process, for technical as well as trust reasons.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-db76f90 elementor-widget elementor-widget-text-editor" data-id="db76f90" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>In practice, providers of E2EVV systems, which range from academic projects to commercial vendors, do not dedicate sufficient resources to ensure that these independent tools and procedures are developed. This is not surprising, because this development is expensive, even more so if done in an independent and principled (with the least amount of assumptions beyond mathematical specifications) way. Moreover, the incentives to dedicate these resources are not in place: <i>there exist no agreed upon precise technical standards that the population at large can use to evaluate to what degree systems are indeed E2EVV</i>. Consequently it is unclear what the return on investment for efforts to meet high standards in this area, including quality verifiers, are.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-066a7be elementor-widget elementor-widget-text-editor" data-id="066a7be" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>At the same time, many existing E2EVV systems share a substantial amount of commonality in the mathematical fundamentals at the base of their verifiability. Indeed, one can classify most E2EVV systems into very few classes according to the main cryptographic techniques they employ. The most cited examples are mixnets, homomorphic tallying, and blind signatures.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-cd5d118 elementor-widget elementor-widget-heading" data-id="cd5d118" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">A Universal Verifier
</h2>		</div>
				</div>
					</div>
				</div>
				<div class="elementor-element elementor-element-1cd84e77 elementor-widget elementor-widget-text-editor" data-id="1cd84e77" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>The combination of these two observations naturally suggests an opportunity to improve the current state of affairs: if most E2EVV systems share substantial underlying technology, it is possible that this commonality could be exploited to achieve a high quality universal verifier compatible with all of them. This universal verifier would be a joint effort from all E2EVV players, in effect being independent of each provider individually. But the benefits of such a project are not limited to improving the state of election verification software.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-5452555 elementor-widget elementor-widget-text-editor" data-id="5452555" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>The work necessary to define and develop a universal verifier for these systems would constitute the first steps towards the definition of precise standards defining and potentially certifying what an E2EVV system is. This is because in order to develop a universal verifier one needs to define verification very precisely (to the point of mechanical execution) and in sufficient generality (to be compatible across all instances of E2EVV). The long term outcome of these first steps would be a robust, rigorous and precise technical standard that would elevate the practices of all participants and instantiations of E2EVV voting. But because there are already benefits in providing a universal verifier compatible with existing systems today, it could be possible to bootstrap a standardisation process without a huge initial investment.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-c92ccf1 elementor-widget elementor-widget-heading" data-id="c92ccf1" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">First steps</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-733aed55 elementor-widget elementor-widget-text-editor" data-id="733aed55" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>The first step in the path towards a universal verifier supporting arbitrary E2EVV systems is to identify a small selection (say 2 or 3) of E2EVV systems currently in use and to develop a prototype that targets them. As a proof of concept this would serve to remove uncertainty from some of the fundamental problems a full fledged universal verifier could present, for example:</p><p> </p><ol><li aria-level="1">Whether it is possible to extract sufficient commonality in underlying mathematical constructions to make a universal verifier generally applicable.</li></ol><p> </p><ol><li aria-level="1">Whether it is possible to extract sufficient commonality in implementations to make a universal verifier viable from the perspective of software complexity. This includes the question of whether the last mile effort to adapt a universal verifier to a particular system constitutes a sufficiently small fraction of total effort.</li></ol><p> </p><ol><li aria-level="1">Whether existing E2EVV system authors and vendors are receptive to collaborating on a universal verifier (and using it as part of their complete solution), as well as participating in the possible standards emerging in the longer term.</li></ol><p> </p><p>Ideally many of these questions would be clarified during the initial stages of a prototype development as well as discussions with relevant parties</p>						</div>
				</div>
				</div>
					</div>
				</div>
				</div>
		<p>The post <a href="/tech/a-universal-approach-to-election-verification-an-opportunity-for-increased-trust-in-elections/">A Universal Approach to Election Verification: An Opportunity for Increased Trust in Elections</a> appeared first on <a href="/">Sequent</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>E-Voting Wasm Cryptography</title>
		<link>/tech/e-voting-wasm-cryptography/</link>
		
		<dc:creator><![CDATA[Serhii Bohynia]]></dc:creator>
		<pubDate>Wed, 07 Dec 2022 07:46:37 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[blog]]></category>
		<guid isPermaLink="false">/?p=2034</guid>

					<description><![CDATA[<p>The Sequent Voting Platform is an open-source E2EV internet voting system currently used in private organisations and non-legally binding elections of public organisations. The system employs standard cryptographic techniques following in the steps of well-established voting schemes proposed in the academic literature. We demo core cryptographic components that are being developed for the next generation [&#8230;]</p>
<p>The post <a href="/tech/e-voting-wasm-cryptography/">E-Voting Wasm Cryptography</a> appeared first on <a href="/">Sequent</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="2034" class="elementor elementor-2034" data-elementor-post-type="post">
				<div class="elementor-element elementor-element-32160e6 e-flex e-con-boxed e-con e-parent" data-id="32160e6" data-element_type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-9ba4bc5 elementor-widget elementor-widget-text-editor" data-id="9ba4bc5" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>The Sequent Voting Platform is an open-source E2EV internet voting system currently used in private organisations and non-legally binding elections of public organisations. The system employs standard cryptographic techniques following in the steps of well-established voting schemes proposed in the academic literature.</p><p>We demo core cryptographic components that are being developed for the next generation of Sequent’s platform. The main novelty demonstrated is the execution of (heavyweight) cryptographic operations in the browser, in a performant way. Potential applications of this technique are listed and possible benefits for security, privacy and verifiability are suggested. </p>						</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-31288e03 e-flex e-con-boxed e-con e-parent" data-id="31288e03" data-element_type="container" data-settings="{&quot;background_background&quot;:&quot;classic&quot;}">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-21bbe259 e-con-full e-flex elementor-invisible e-con e-child" data-id="21bbe259" data-element_type="container" data-settings="{&quot;animation&quot;:&quot;fadeInLeft&quot;}">
				<div class="elementor-element elementor-element-59162297 elementor-widget elementor-widget-button" data-id="59162297" data-element_type="widget" data-widget_type="button.default">
				<div class="elementor-widget-container">
					<div class="elementor-button-wrapper">
			<a class="elementor-button elementor-button-link elementor-size-sm" href="/blog/">
						<span class="elementor-button-content-wrapper">
						<span class="elementor-button-icon elementor-align-icon-left">
				<i aria-hidden="true" class="fas fa-angle-left"></i>			</span>
									<span class="elementor-button-text">Go Back</span>
					</span>
					</a>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-5ec65e0a elementor-widget elementor-widget-heading" data-id="5ec65e0a" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<div class="elementor-heading-title elementor-size-default">Blog</div>		</div>
				</div>
				<div class="elementor-element elementor-element-32f586ae elementor-widget__width-inherit elementor-widget elementor-widget-theme-post-title elementor-page-title elementor-widget-heading" data-id="32f586ae" data-element_type="widget" data-widget_type="theme-post-title.default">
				<div class="elementor-widget-container">
			<h1 class="elementor-heading-title elementor-size-default">E-Voting Wasm Cryptography</h1>		</div>
				</div>
				<div class="elementor-element elementor-element-4a913ddf elementor-widget elementor-widget-text-editor" data-id="4a913ddf" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<span>Blog</span>, <span>Technology</span>						</div>
				</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-238b42d9 e-flex e-con-boxed e-con e-parent" data-id="238b42d9" data-element_type="container">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-592c0159 e-con-full e-flex e-con e-child" data-id="592c0159" data-element_type="container">
				<div class="elementor-element elementor-element-6e3a0ed2 uael-heading-align-left elementor-widget elementor-widget-uael-table-of-contents" data-id="6e3a0ed2" data-element_type="widget" data-settings="{&quot;heading_bottom_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:0,&quot;sizes&quot;:[]},&quot;content_between_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:16,&quot;sizes&quot;:[]},&quot;sticky&quot;:&quot;top&quot;,&quot;sticky_on&quot;:[&quot;desktop&quot;,&quot;tablet&quot;],&quot;scroll_offset&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;scroll_offset_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;scroll_offset_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;heading_text_align&quot;:&quot;left&quot;,&quot;heading_bottom_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;heading_bottom_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;content_between_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;content_between_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;sticky_offset&quot;:0,&quot;sticky_effects_offset&quot;:0}" data-widget_type="uael-table-of-contents.default">
				<div class="elementor-widget-container">
					<div class="uael-toc-main-wrapper" data-headings="h2,h3" >
			<div class="uael-toc-wrapper">
				<div class="uael-toc-header">
					<span class="uael-toc-heading elementor-inline-editing" data-elementor-setting-key="heading_title" data-elementor-inline-editing-toolbar="basic" ></span>
									</div>
								<div class="uael-toc-toggle-content">
					<div class="uael-toc-content-wrapper">
						
							<ul data-toc-headings="headings" class="uael-toc-list uael-toc-list-none" data-scroll="500" ></ul>
											</div>
				</div>
				<div class="uael-toc-empty-note">
					<span>Add a header to begin generating the table of contents</span>
				</div>
			</div>
					</div>
				</div>
				</div>
				</div>
		<div class="elementor-element elementor-element-684589af e-con-full e-flex e-con e-child" data-id="684589af" data-element_type="container">
				<div class="elementor-element elementor-element-5b63f20d elementor-widget elementor-widget-image" data-id="5b63f20d" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="768" height="403" src="/wp-content/uploads/2024/03/wasm-crypto-1-768x403-1.png" class="attachment-full size-full wp-image-2035" alt="" srcset="/wp-content/uploads/2024/03/wasm-crypto-1-768x403-1.png 768w, /wp-content/uploads/2024/03/wasm-crypto-1-768x403-1-300x157.png 300w" sizes="(max-width: 768px) 100vw, 768px" />													</div>
				</div>
		<div class="elementor-element elementor-element-af42deb e-flex e-con-boxed e-con e-child" data-id="af42deb" data-element_type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-2a74a170 elementor-widget elementor-widget-text-editor" data-id="2a74a170" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>The Sequent Voting Platform is an open-source E2EV internet voting system currently used in private organisations and non-legally binding elections of public organisations. The system employs standard cryptographic techniques following in the steps of well-established voting schemes proposed in the academic literature.</p><p>We demo core cryptographic components that are being developed for the next generation of Sequent’s platform. The main novelty demonstrated is the execution of (heavyweight) cryptographic operations in the browser, in a performant way. Potential applications of this technique are listed and possible benefits for security, privacy and verifiability are suggested. </p>						</div>
				</div>
				<div class="elementor-element elementor-element-e5c68e0 elementor-widget elementor-widget-heading" data-id="e5c68e0" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Introduction</h2>		</div>
				</div>
					</div>
				</div>
				<div class="elementor-element elementor-element-3e370b99 elementor-widget elementor-widget-text-editor" data-id="3e370b99" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Like many other systems proposed in the literature, the closest ancestor in Sequent’s genealogy tree is <a href="https://www.usenix.org/legacy/event/sec08/tech/full_papers/adida/adida.pdf">Helios</a>[1] in its original mixnet variant. The most significant departures from that Helios design are the use of a threshold distributed key generation mechanism, described in <a href="https://www.cs.cornell.edu/courses/cs754/2001fa/129.PDF">Pedersen</a>[2] and featured in <a href="https://www.win.tue.nl/~berry/papers/euro97.pdf">CGS</a>[3] and Distributed <a href="https://members.loria.fr/VCortier/files/Papers/WPES2013.pdf">Helios</a>[4], and the use of a <a href="http://www.csc.kth.se/~terelius/TeWi10Full.pdf">Terelius-Wikstrom</a>[5] style mixnet rather than the <a href="https://link.springer.com/content/pdf/10.1007/3-540-49264-X_32.pdf">Sako-Kilian</a>[6] one. Other systems with which Sequent shares techniques are <a href="https://wombat.factcenter.org/">Wombat</a>[7] and <a href="https://eprint.iacr.org/2017/325">CHVote</a>[8]. </p><p>Research and development into Sequent’s next generation system is currently underway. Part of this effort has been centred around the use of <a href="https://www.rust-lang.org/">Rust</a>[9] as a core technology. One of the interesting aspects of this technology is its ability to target <a href="https://webassembly.org/">WebAssembly</a>[10] through the <a href="https://llvm.org/">LLVM</a>[11] toolchain. </p><p>Internet voting systems require the use of a client component with which voters select and encrypt their votes, typically in a browser. In the past, these components have been written in Javascript or related languages. These components replicate some of the cryptography (for example, ElGamal encryption) that later processes votes in the backend. The initial motivating factor for our investigation of Rust’s WebAssembly target was the possibility of merging this overlapping cryptography into a single unified codebase. But there are further interesting possibilities.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-fec7d96 elementor-widget elementor-widget-heading" data-id="fec7d96" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Applications</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-52cf8533 elementor-widget elementor-widget-heading" data-id="52cf8533" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">Vote casting
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-6b727d99 elementor-widget elementor-widget-text-editor" data-id="6b727d99" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Voting client software can reuse common cryptography packaged in a library compiled to Wasm, eliminating duplication.</p><p>Suggested benefits:</p><ul><li aria-level="1">Security: A unified code base reduces the likelihood of mismatches between client and server cryptography, and reduces the attack surface. The amount of code that needs to be audited is also reduced.</li></ul><ul><li aria-level="1">Performance: Higher performance compared to Javascript implementations.</li></ul>						</div>
				</div>
				<div class="elementor-element elementor-element-41a5f00 elementor-widget elementor-widget-heading" data-id="41a5f00" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">Ballot verification
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-2a232a1f elementor-widget elementor-widget-text-editor" data-id="2a232a1f" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Ballot verifiers implementing the Benaloh challenge can reuse common cryptography packaged in a library compiled to Wasm, eliminating duplication.</p><p>Suggested benefits: As above.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-f627269 elementor-widget elementor-widget-heading" data-id="f627269" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">Election verification
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-9d745b9 elementor-widget elementor-widget-text-editor" data-id="9d745b9" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Election verification, usually carried out by specialised software that must be downloaded and configured, can be executed in the browser with no installation.</p><p>Suggested  benefits: </p><ul><li aria-level="1">Verifiability: Making election verification procedures significantly more usable can achieve higher rates of exercised verification, moving the “universal” part of universal verifiability closer to practice.</li></ul><p>Note that achieving performant implementations in this use case is particularly difficult as election verification involves compute intensive operations that a priori seem impossible in a browser. We have not listed performance as a benefit here as we are comparing with non-browser, native implementations; in other words, performance is a must-have rather than a benefit for this use case.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-6f7c004 elementor-widget elementor-widget-heading" data-id="6f7c004" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">Trustee protocols
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-61f1ffd elementor-widget elementor-widget-text-editor" data-id="61f1ffd" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Running full trustee nodes on the browser with reduced deployment, administration and training costs.</p><p>Suggested benefits:</p><p>Real world experience has taught us that one of the barriers to running mixnet-based elections with a larger number of independent trustees is the cost that these trustees must incur in terms of deployment, administration and training. This is especially true for elections with fewer resources in human capital and infrastructure. As a result, it is not always easy to procure independent trustees to assume this important responsibility.</p><p>Any objective that is presumably achieved through distribution into independent trustees could be achieved to a greater degree when some of the costs of this distribution are reduced. For example:</p><ul><li aria-level="1">Privacy: Ballot secrecy safeguards achieved through the distribution of private key material and mixing permutations would be achieved to a higher degree if more trustees participate.</li><li aria-level="1">Security: Correctness safeguards achieved through distribution of mixing and tallying  would be achieved to a higher degree if more trustees participate.</li></ul><p>See previous section regarding performance as a benefit.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-62666ad9 elementor-widget elementor-widget-heading" data-id="62666ad9" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Demonstration</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-ccb59b7 elementor-widget elementor-widget-text-editor" data-id="ccb59b7" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>We choose to demonstrate the most complex scenario described above, as it’s a proof of concept that also validates the rest of the comparatively simpler use cases. We show how trustee operations, both shuffling and decryption, can be run in the browser. We will also show that the resulting performance numbers fall within the threshold of practical applicability in small to medium elections. </p><p>As stated previously, achieving performant mixing in the browser is a particularly difficult task: this requires cutting edge technology that is currently experimental. Additionally, the full security implications of applying these techniques have to be analysed in detail.</p><p>You can <a href="https://strand_github_pages.sequentech.io/demo.html">access the demo directly from your web browser here</a> [12] ** and you can also see a video of how the demo performs running in the browser below:</p>						</div>
				</div>
				<div class="elementor-element elementor-element-8fab766 elementor-widget elementor-widget-video" data-id="8fab766" data-element_type="widget" data-settings="{&quot;video_type&quot;:&quot;hosted&quot;,&quot;controls&quot;:&quot;yes&quot;}" data-widget_type="video.default">
				<div class="elementor-widget-container">
			<style>/*! elementor - v3.21.0 - 26-05-2024 */
.elementor-widget-video .elementor-widget-container{overflow:hidden;transform:translateZ(0)}.elementor-widget-video .elementor-wrapper{aspect-ratio:var(--video-aspect-ratio)}.elementor-widget-video .elementor-wrapper iframe,.elementor-widget-video .elementor-wrapper video{height:100%;width:100%;display:flex;border:none;background-color:#000}@supports not (aspect-ratio:1/1){.elementor-widget-video .elementor-wrapper{position:relative;overflow:hidden;height:0;padding-bottom:calc(100% / var(--video-aspect-ratio))}.elementor-widget-video .elementor-wrapper iframe,.elementor-widget-video .elementor-wrapper video{position:absolute;top:0;right:0;bottom:0;left:0}}.elementor-widget-video .elementor-open-inline .elementor-custom-embed-image-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background-size:cover;background-position:50%}.elementor-widget-video .elementor-custom-embed-image-overlay{cursor:pointer;text-align:center}.elementor-widget-video .elementor-custom-embed-image-overlay:hover .elementor-custom-embed-play i{opacity:1}.elementor-widget-video .elementor-custom-embed-image-overlay img{display:block;width:100%;aspect-ratio:var(--video-aspect-ratio);-o-object-fit:cover;object-fit:cover;-o-object-position:center center;object-position:center center}@supports not (aspect-ratio:1/1){.elementor-widget-video .elementor-custom-embed-image-overlay{position:relative;overflow:hidden;height:0;padding-bottom:calc(100% / var(--video-aspect-ratio))}.elementor-widget-video .elementor-custom-embed-image-overlay img{position:absolute;top:0;right:0;bottom:0;left:0}}.elementor-widget-video .e-hosted-video .elementor-video{-o-object-fit:cover;object-fit:cover}.e-con-inner>.elementor-widget-video,.e-con>.elementor-widget-video{width:var(--container-widget-width);--flex-grow:var(--container-widget-flex-grow)}</style>		<div class="e-hosted-video elementor-wrapper elementor-open-inline">
					<video class="elementor-video" src="/wp-content/uploads/2024/03/evoting-wasm-cryptography-demo.mov" controls="" preload="metadata" controlsList="nodownload"></video>
				</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-5f398e9 elementor-widget elementor-widget-heading" data-id="5f398e9" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Note</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-7fb148c elementor-widget elementor-widget-text-editor" data-id="7fb148c" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<div>This document was presented in its original form for the E-Vote-ID 2022 conference as a short paper for the Demo Session. You can find this short paper in the <a href="https://dspace.ut.ee/handle/10062/84432">E-Vote-ID 2022 proceedings</a> [13] at page 175. </div>						</div>
				</div>
				<div class="elementor-element elementor-element-df8f40e elementor-widget elementor-widget-heading" data-id="df8f40e" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">References</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-3d372435 elementor-widget elementor-widget-text-editor" data-id="3d372435" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>[1] <a href="https://www.usenix.org/legacy/event/sec08/tech/full_papers/adida/adida.pdf">Helios: Web-based Open-Audit Voting</a><br />[2] <a href="https://www.cs.cornell.edu/courses/cs754/2001fa/129.PDF">Non-interactive and information-theoretic secure verifiable secret sharing</a><br />[3] <a href="https://www.win.tue.nl/~berry/papers/euro97.pdf">A secure and optimally efficient multi-authority election scheme<br /></a>[4] <a href="https://members.loria.fr/VCortier/files/Papers/WPES2013.pdf">Distributed ElGamal à la Pedersen: Application to Helios</a><br />[5] <a href="http://www.csc.kth.se/~terelius/TeWi10Full.pdf">Proofs of Restricted Shuffles<br /></a>[6] <a href="https://link.springer.com/content/pdf/10.1007/3-540-49264-X_32.pdf">Receipt-free mix-type voting scheme — a practical solution to the implementation of a voting booth<br /></a>[7a] <a href="https://wombat.factcenter.org/">Wombat Voting</a><br />[7b] <a href="http://www.cs.tau.ac.il/~amnon/Students/niko.farhi.pdf">An Implementation of Dual (Paper and Cryptographic) Voting System<br /></a>[8] <a href="https://eprint.iacr.org/2017/325">CHVote Protocol Specification</a><br />[9] <a href="https://www.rust-lang.org/">https://www.rust-lang.org/</a><br />[10] <a href="https://webassembly.org/">https://webassembly.org/</a><br />[11] <a href="https://llvm.org/">https://llvm.org/</a><br />[12] <a href="https://strand_github_pages.sequentech.io/demo.html">https://strand_github_pages.sequentech.io/demo.html</a><br />[13] <a href="https://dspace.ut.ee/handle/10062/84432">https://dspace.ut.ee/handle/10062/84432</a> (page 175)</p>						</div>
				</div>
				</div>
					</div>
				</div>
				</div>
		<p>The post <a href="/tech/e-voting-wasm-cryptography/">E-Voting Wasm Cryptography</a> appeared first on <a href="/">Sequent</a>.</p>
]]></content:encoded>
					
		
		<enclosure url="/wp-content/uploads/2024/03/evoting-wasm-cryptography-demo.mov" length="0" type="video/quicktime" />

			</item>
		<item>
		<title>Plaintext Encoding in ElGamal</title>
		<link>/tech/plaintext-encoding-in-elgamal/</link>
		
		<dc:creator><![CDATA[Serhii Bohynia]]></dc:creator>
		<pubDate>Tue, 22 Nov 2022 07:52:33 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[blog]]></category>
		<guid isPermaLink="false">/?p=2042</guid>

					<description><![CDATA[<p>In cryptography, ElGamal  is an asymmetric cryptosystem in which public and private keys are used to encrypt communication between two parties. ElGamal encryption plays a similar role to the more commonly known RSA and is easily adaptable to a variety of cryptographic groups, and is semantically secure provided that the DDH assumption holds. In the [&#8230;]</p>
<p>The post <a href="/tech/plaintext-encoding-in-elgamal/">Plaintext Encoding in ElGamal</a> appeared first on <a href="/">Sequent</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="2042" class="elementor elementor-2042" data-elementor-post-type="post">
				<div class="elementor-element elementor-element-77783de7 e-flex e-con-boxed e-con e-parent" data-id="77783de7" data-element_type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-52d70e11 elementor-widget elementor-widget-text-editor" data-id="52d70e11" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>In cryptography, ElGamal  is an asymmetric cryptosystem in which public and private keys are used to encrypt communication between two parties.</p><p>ElGamal encryption plays a similar role to the more commonly known RSA and is easily adaptable to a variety of cryptographic groups, and is semantically secure provided that the DDH assumption holds. In the case of internet voting, ElGamal is usually instantiated over a multiplicative subgroup induced by a safe prime. This requires that plaintext data must be first encoded into this subgroup before it can be encrypted.</p>						</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-6e98169d e-flex e-con-boxed e-con e-parent" data-id="6e98169d" data-element_type="container" data-settings="{&quot;background_background&quot;:&quot;classic&quot;}">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-5fac4711 e-con-full e-flex elementor-invisible e-con e-child" data-id="5fac4711" data-element_type="container" data-settings="{&quot;animation&quot;:&quot;fadeInLeft&quot;}">
				<div class="elementor-element elementor-element-738b882d elementor-widget elementor-widget-button" data-id="738b882d" data-element_type="widget" data-widget_type="button.default">
				<div class="elementor-widget-container">
					<div class="elementor-button-wrapper">
			<a class="elementor-button elementor-button-link elementor-size-sm" href="/blog/">
						<span class="elementor-button-content-wrapper">
						<span class="elementor-button-icon elementor-align-icon-left">
				<i aria-hidden="true" class="fas fa-angle-left"></i>			</span>
									<span class="elementor-button-text">Go Back</span>
					</span>
					</a>
		</div>
				</div>
				</div>
				<div class="elementor-element elementor-element-565d8b9d elementor-widget elementor-widget-heading" data-id="565d8b9d" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<div class="elementor-heading-title elementor-size-default">Blog</div>		</div>
				</div>
				<div class="elementor-element elementor-element-586f3651 elementor-widget__width-inherit elementor-widget elementor-widget-theme-post-title elementor-page-title elementor-widget-heading" data-id="586f3651" data-element_type="widget" data-widget_type="theme-post-title.default">
				<div class="elementor-widget-container">
			<h1 class="elementor-heading-title elementor-size-default">Plaintext Encoding in ElGamal</h1>		</div>
				</div>
				<div class="elementor-element elementor-element-6ba6eaa2 elementor-widget elementor-widget-text-editor" data-id="6ba6eaa2" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<span>Blog</span>, <span>Technology</span>						</div>
				</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-76278560 e-flex e-con-boxed e-con e-parent" data-id="76278560" data-element_type="container">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-5b34d7f5 e-con-full e-flex e-con e-child" data-id="5b34d7f5" data-element_type="container">
				<div class="elementor-element elementor-element-398648e5 uael-heading-align-left elementor-widget elementor-widget-uael-table-of-contents" data-id="398648e5" data-element_type="widget" data-settings="{&quot;heading_bottom_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:0,&quot;sizes&quot;:[]},&quot;content_between_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:16,&quot;sizes&quot;:[]},&quot;sticky&quot;:&quot;top&quot;,&quot;sticky_on&quot;:[&quot;desktop&quot;,&quot;tablet&quot;],&quot;scroll_offset&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;scroll_offset_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;scroll_offset_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;heading_text_align&quot;:&quot;left&quot;,&quot;heading_bottom_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;heading_bottom_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;separator_bottom_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;content_between_space_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;content_between_space_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;sticky_offset&quot;:0,&quot;sticky_effects_offset&quot;:0}" data-widget_type="uael-table-of-contents.default">
				<div class="elementor-widget-container">
					<div class="uael-toc-main-wrapper" data-headings="h2,h3" >
			<div class="uael-toc-wrapper">
				<div class="uael-toc-header">
					<span class="uael-toc-heading elementor-inline-editing" data-elementor-setting-key="heading_title" data-elementor-inline-editing-toolbar="basic" ></span>
									</div>
								<div class="uael-toc-toggle-content">
					<div class="uael-toc-content-wrapper">
						
							<ul data-toc-headings="headings" class="uael-toc-list uael-toc-list-none" data-scroll="500" ></ul>
											</div>
				</div>
				<div class="uael-toc-empty-note">
					<span>Add a header to begin generating the table of contents</span>
				</div>
			</div>
					</div>
				</div>
				</div>
				</div>
		<div class="elementor-element elementor-element-58864080 e-con-full e-flex e-con e-child" data-id="58864080" data-element_type="container">
				<div class="elementor-element elementor-element-cc300d7 elementor-widget elementor-widget-image" data-id="cc300d7" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="768" height="403" src="/wp-content/uploads/2024/03/elgamal-blog-cover-768x403-1.png" class="attachment-full size-full wp-image-2043" alt="" srcset="/wp-content/uploads/2024/03/elgamal-blog-cover-768x403-1.png 768w, /wp-content/uploads/2024/03/elgamal-blog-cover-768x403-1-300x157.png 300w" sizes="(max-width: 768px) 100vw, 768px" />													</div>
				</div>
		<div class="elementor-element elementor-element-5f98e15a e-flex e-con-boxed e-con e-child" data-id="5f98e15a" data-element_type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-5577e75e elementor-widget elementor-widget-text-editor" data-id="5577e75e" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>In cryptography, ElGamal  is an asymmetric cryptosystem in which public and private keys are used to encrypt communication between two parties.</p><p>ElGamal encryption plays a similar role to the more commonly known RSA and is easily adaptable to a variety of cryptographic groups, and is semantically secure provided that the DDH assumption holds. In the case of internet voting, ElGamal is usually instantiated over a multiplicative subgroup induced by a safe prime. This requires that plaintext data must be first encoded into this subgroup before it can be encrypted.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-a63924b elementor-widget elementor-widget-image" data-id="a63924b" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="800" height="420" src="/wp-content/uploads/2024/03/plaintext-elgamal-1024x538.png" class="attachment-large size-large wp-image-2046" alt="" srcset="/wp-content/uploads/2024/03/plaintext-elgamal-1024x538.png 1024w, /wp-content/uploads/2024/03/plaintext-elgamal-300x158.png 300w, /wp-content/uploads/2024/03/plaintext-elgamal-768x403.png 768w, /wp-content/uploads/2024/03/plaintext-elgamal.png 1200w" sizes="(max-width: 800px) 100vw, 800px" />													</div>
				</div>
					</div>
				</div>
				<div class="elementor-element elementor-element-74bd46a9 elementor-widget elementor-widget-text-editor" data-id="74bd46a9" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>To ensure ballot privacy, the Sequent voting system uses an ElGamal re-encryption mixnet. As mentioned above, protected data must first be encoded into the plaintext space in which ElGamal operates. The information can be encrypted once it has been encoded in this space. During decryption, the ciphertexts are decrypted first, and then the plaintexts are encoded back into the original data.</p><p>ElGamal’s plaintext (and ciphertext) space is a multiplicative subgroup Gq, for some choice of p, a safe prime modulus such that p = 2q + 1. In order to encode data, first convert it into an integer (a universal data type that can hold any information), and then map it into Gq. In a single ciphertext, the number of integers that can be encoded is determined by the order q of Gq, so we can map numbers from Zq into Gq.</p><p>As I couldn’t find any references describing this simple procedure well, I decided to write it myself.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-dac7726 elementor-widget elementor-widget-heading" data-id="dac7726" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Encoding With the Legendre Symbol
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-60e418e1 elementor-widget elementor-widget-text-editor" data-id="60e418e1" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>One reference we <i>can</i> find is this from <a href="http://www.springer.com/gp/book/9783319566160">Advances in Cryptology — EUROCRYPT 2017</a>.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-00d33b8 elementor-widget elementor-widget-image" data-id="00d33b8" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="800" height="192" src="/wp-content/uploads/2024/03/legendre0-1024x246.jpg" class="attachment-large size-large wp-image-2047" alt="" srcset="/wp-content/uploads/2024/03/legendre0-1024x246.jpg 1024w, /wp-content/uploads/2024/03/legendre0-300x72.jpg 300w, /wp-content/uploads/2024/03/legendre0-768x184.jpg 768w, /wp-content/uploads/2024/03/legendre0.jpg 1180w" sizes="(max-width: 800px) 100vw, 800px" />													</div>
				</div>
				<div class="elementor-element elementor-element-37cacdee elementor-widget elementor-widget-text-editor" data-id="37cacdee" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>To begin with, when using a safe prime p = 2q + 1, the multiplicative subgroup Gq is the set of quadratic residues mod p, which makes the scheme <a href="https://en.wikipedia.org/wiki/ElGamal_encryption#Security">semantically secure</a>. Accordingly, we should use the simple m x (m/p) encoding procedure. But why is (m/p) x m guaranteed to be a quadratic residue? The reference contains hints, which we expand on below.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-1314721 elementor-widget elementor-widget-heading" data-id="1314721" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">Step 1: the legendre symbol is defined as
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-73e1a66 elementor-widget elementor-widget-image" data-id="73e1a66" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="800" height="101" src="/wp-content/uploads/2024/03/legendre1-1024x129.png" class="attachment-large size-large wp-image-2048" alt="" srcset="/wp-content/uploads/2024/03/legendre1-1024x129.png 1024w, /wp-content/uploads/2024/03/legendre1-300x38.png 300w, /wp-content/uploads/2024/03/legendre1-768x97.png 768w, /wp-content/uploads/2024/03/legendre1.png 1180w" sizes="(max-width: 800px) 100vw, 800px" />													</div>
				</div>
				<div class="elementor-element elementor-element-7a17cf1a elementor-widget elementor-widget-text-editor" data-id="7a17cf1a" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>When the input integers range from q to p, then there are only two possibilities for encoding.</p><p>The expression (m/p) x m reduces to leaving m unchanged (1 x m) or reversing its sign (-1 x m). In particular, if m is already a residue, then (m/p) x m is still a residue since (1 x m) = m.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-262ff38 elementor-widget elementor-widget-heading" data-id="262ff38" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">Step 2: we have that
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-3878b20 elementor-widget elementor-widget-image" data-id="3878b20" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="800" height="20" src="/wp-content/uploads/2024/03/legendre2-1024x26.png" class="attachment-large size-large wp-image-2049" alt="" srcset="/wp-content/uploads/2024/03/legendre2-1024x26.png 1024w, /wp-content/uploads/2024/03/legendre2-300x8.png 300w, /wp-content/uploads/2024/03/legendre2-768x20.png 768w, /wp-content/uploads/2024/03/legendre2.png 1180w" sizes="(max-width: 800px) 100vw, 800px" />													</div>
				</div>
				<div class="elementor-element elementor-element-51ebe50 elementor-widget elementor-widget-heading" data-id="51ebe50" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">Step 3: the first supplement of the law of quadratic reciprocity states
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-af484d9 elementor-widget elementor-widget-image" data-id="af484d9" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="800" height="24" src="/wp-content/uploads/2024/03/legendre3-1024x31.png" class="attachment-large size-large wp-image-2050" alt="" srcset="/wp-content/uploads/2024/03/legendre3-1024x31.png 1024w, /wp-content/uploads/2024/03/legendre3-300x9.png 300w, /wp-content/uploads/2024/03/legendre3-768x23.png 768w, /wp-content/uploads/2024/03/legendre3.png 1180w" sizes="(max-width: 800px) 100vw, 800px" />													</div>
				</div>
				<div class="elementor-element elementor-element-452d0758 elementor-widget elementor-widget-text-editor" data-id="452d0758" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>since p is a prime, then p mod 4 has only two possible values (1 and 3), so</p><p><i>if p ≡ 3 (mod 4) then -1 is a nonresidue modulo p</i></p>						</div>
				</div>
				<div class="elementor-element elementor-element-1c17f4eb elementor-widget elementor-widget-heading" data-id="1c17f4eb" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">Step 4: our modulus p is a safe prime p = 2q + 1, where q is also a prime. Meaning:
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-2914c7ec elementor-widget elementor-widget-text-editor" data-id="2914c7ec" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p><i>q = 1 mod 4 or q = 3 mod 4</i></p><p>Expanding each case[1]</p><p>*q = 1 mod 4 ⇒ **2q = 2 mod 4 ⇒ **2q + 1 = 3 mod 4 ⇒ *<i>p = 3 mod 4</i></p><p>similarly</p><p><i>q = 3 mod 4 ⇒ 2q 4 = 6 mod 4 ⇒ 2q = 2 mod 4 ⇒ p = 3 mod 4</i></p><p>Therefore in both cases, for a safe prime p, we have</p><p><i>p = 3 mod 4</i></p><p>Now, in reverse order, we combine each of the previous four steps. By the step 4 we have:</p><p><i>p = 3 mod 4</i></p><p>which by step 3 implies that</p><p><i>-1 is a nonresidue modulo p</i></p><p>which by step 2 implies that</p><p><i>(-1 x m) is a residue if m is not a residue</i></p><p>which by step 1 implies that</p><p><i>(m/p) x m is a residue if m is not a residue</i></p><p>Also by step 1 we saw that</p><p><i>(m/p) x m = 1 x m is a residue if m is a residue</i></p>						</div>
				</div>
				<div class="elementor-element elementor-element-35b00d08 elementor-widget elementor-widget-heading" data-id="35b00d08" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h3 class="elementor-heading-title elementor-size-default">Therefore in all cases
</h3>		</div>
				</div>
				<div class="elementor-element elementor-element-36fe6bd5 elementor-widget elementor-widget-text-editor" data-id="36fe6bd5" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p><i>(m/p) x m is a quadratic residue modulo p for a safe prime p = 2q + 1</i></p><p>which is what we set out to prove.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-823262c elementor-widget elementor-widget-heading" data-id="823262c" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Helios and Univote Example Code
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-30c8438 elementor-widget elementor-widget-text-editor" data-id="30c8438" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Using ElGamal encryption, let’s take a look at two open source e-voting projects, <a href="https://heliosvoting.org/">Helios</a> by <a href="http://ben.adida.net/">Ben Adida</a> and <a href="https://e-voting.bfh.ch/projects/univote/">UniVote</a> by the <a href="https://e-voting.bfh.ch/">Bern E-voting group</a>. Due to the fact that the voting booth runs in the browser, the code is written in JavaScript. The ElGamal encoding of integers is found in Helios’ <a href="https://github.com/benadida/helios/blob/7c70284246b1ad38ab16ff7b1026af341ab3841f/static/elgamal.js#L336">elgamal.jsfile</a>, which is also included in Sequent’s voting booth.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-fb58a1a elementor-blockquote--skin-border elementor-blockquote--button-color-official elementor-widget elementor-widget-blockquote" data-id="fb58a1a" data-element_type="widget" data-widget_type="blockquote.default">
				<div class="elementor-widget-container">
			<style>/*! elementor-pro - v3.21.0 - 20-05-2024 */
@charset "UTF-8";.entry-content blockquote.elementor-blockquote:not(.alignright):not(.alignleft),.entry-summary blockquote.elementor-blockquote{margin-right:0;margin-left:0}.elementor-widget-blockquote blockquote{margin:0;padding:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;quotes:none;border:0;font-style:normal;color:#3f444b}.elementor-widget-blockquote blockquote .e-q-footer:after,.elementor-widget-blockquote blockquote .e-q-footer:before,.elementor-widget-blockquote blockquote:after,.elementor-widget-blockquote blockquote:before,.elementor-widget-blockquote blockquote cite:after,.elementor-widget-blockquote blockquote cite:before{content:none}.elementor-blockquote{transition:.3s}.elementor-blockquote__author,.elementor-blockquote__content{margin-bottom:0;font-style:normal}.elementor-blockquote__author{font-weight:700}.elementor-blockquote .e-q-footer{margin-top:12px;display:flex;justify-content:space-between}.elementor-blockquote__tweet-button{display:flex;transition:.3s;color:#1da1f2;align-self:flex-end;line-height:1;position:relative;width:-moz-max-content;width:max-content}.elementor-blockquote__tweet-button:hover{color:#0967a0}.elementor-blockquote__tweet-button span{font-weight:600}.elementor-blockquote__tweet-button i,.elementor-blockquote__tweet-button span{vertical-align:middle}.elementor-blockquote__tweet-button i+span,.elementor-blockquote__tweet-button svg+span{margin-inline-start:.5em}.elementor-blockquote__tweet-button svg{fill:#1da1f2;height:1em;width:1em}.elementor-blockquote__tweet-label{white-space:pre-wrap}.elementor-blockquote--button-skin-bubble .elementor-blockquote__tweet-button,.elementor-blockquote--button-skin-classic .elementor-blockquote__tweet-button{padding:.7em 1.2em;border-radius:100em;background-color:#1da1f2;color:#fff;font-size:15px}.elementor-blockquote--button-skin-bubble .elementor-blockquote__tweet-button:hover,.elementor-blockquote--button-skin-classic .elementor-blockquote__tweet-button:hover{background-color:#0967a0;color:#fff}.elementor-blockquote--button-skin-bubble .elementor-blockquote__tweet-button:hover:before,.elementor-blockquote--button-skin-classic .elementor-blockquote__tweet-button:hover:before{border-inline-end-color:#0967a0}.elementor-blockquote--button-skin-bubble .elementor-blockquote__tweet-button svg,.elementor-blockquote--button-skin-classic .elementor-blockquote__tweet-button svg{fill:#fff;height:1em;width:1em}.elementor-blockquote--button-skin-bubble.elementor-blockquote--button-view-icon .elementor-blockquote__tweet-button,.elementor-blockquote--button-skin-classic.elementor-blockquote--button-view-icon .elementor-blockquote__tweet-button{padding:0;width:2em;height:2em}.elementor-blockquote--button-skin-bubble.elementor-blockquote--button-view-icon .elementor-blockquote__tweet-button i,.elementor-blockquote--button-skin-classic.elementor-blockquote--button-view-icon .elementor-blockquote__tweet-button i{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.elementor-blockquote--button-skin-bubble .elementor-blockquote__tweet-button:before{content:"";border:.5em solid transparent;border-inline-end-color:#1da1f2;position:absolute;left:-.8em;top:50%;transform:translateY(-50%) scaleY(.65);transition:.3s}.elementor-blockquote--button-skin-bubble.elementor-blockquote--align-left .elementor-blockquote__tweet-button:before{right:auto;left:-.8em;border-right-color:#1da1f2;border-left-color:transparent}.elementor-blockquote--button-skin-bubble.elementor-blockquote--align-left .elementor-blockquote__tweet-button:hover:before{border-right-color:#0967a0}.elementor-blockquote--button-skin-bubble.elementor-blockquote--align-right .elementor-blockquote__tweet-button:before{left:auto;right:-.8em;border-right-color:transparent;border-left-color:#1da1f2}.elementor-blockquote--button-skin-bubble.elementor-blockquote--align-right .elementor-blockquote__tweet-button:hover:before{border-left-color:#0967a0}.elementor-blockquote--skin-boxed .elementor-blockquote{background-color:#f9fafa;padding:30px}.elementor-blockquote--skin-border .elementor-blockquote{border-color:#f9fafa;border-style:solid;border-inline-start-width:7px;padding-inline-start:20px}.elementor-blockquote--skin-quotation .elementor-blockquote:before{content:"“";font-size:100px;color:#f9fafa;font-family:Times New Roman,Times,serif;font-weight:900;line-height:1;display:block;height:.6em}.elementor-blockquote--skin-quotation .elementor-blockquote__content{margin-top:15px}.elementor-blockquote--align-left .elementor-blockquote__content{text-align:left}.elementor-blockquote--align-left .elementor-blockquote .e-q-footer{flex-direction:row}.elementor-blockquote--align-right .elementor-blockquote__content{text-align:right}.elementor-blockquote--align-right .elementor-blockquote .e-q-footer{flex-direction:row-reverse}.elementor-blockquote--align-center .elementor-blockquote{text-align:center}.elementor-blockquote--align-center .elementor-blockquote .e-q-footer,.elementor-blockquote--align-center .elementor-blockquote__author{display:block}.elementor-blockquote--align-center .elementor-blockquote__tweet-button{margin-right:auto;margin-left:auto}</style>		<blockquote class="elementor-blockquote">
			<p class="elementor-blockquote__content">
				var y = m.add(BigInt.ONE);<br>
var test = y.modPow(pk.q, pk.p);<br>
if (test.equals(BigInt.ONE)) {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.m = y;<br>
} else {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    this.m = y.negate().mod(pk.p);<br>
}			</p>
					</blockquote>
				</div>
				</div>
				<div class="elementor-element elementor-element-1bb33fec elementor-widget elementor-widget-text-editor" data-id="1bb33fec" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Due to the fact that the subgroup Gq does not include the value zero, the first line adds one to the input. Following these lines are the implementations of (m/p) x m encoding. As you may recall, the legendre symbol can take on either a value of 1 or a value of -1. In the case (1 x m), the first branch of the if statement leaves m unchanged. This second branch corresponds to changing the sign of m, the (-1 x m) case. Calculation of the legendre symbol is based on <a href="https://en.wikipedia.org/wiki/Euler%27s_criterion">Euler’s criterion</a> in the if statement</p>						</div>
				</div>
				<div class="elementor-element elementor-element-3e72e78 elementor-widget elementor-widget-image" data-id="3e72e78" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="800" height="420" src="/wp-content/uploads/2024/03/elgamal-equation-1024x538.png" class="attachment-large size-large wp-image-2051" alt="" srcset="/wp-content/uploads/2024/03/elgamal-equation-1024x538.png 1024w, /wp-content/uploads/2024/03/elgamal-equation-300x158.png 300w, /wp-content/uploads/2024/03/elgamal-equation-768x403.png 768w, /wp-content/uploads/2024/03/elgamal-equation.png 1200w" sizes="(max-width: 800px) 100vw, 800px" />													</div>
				</div>
				<div class="elementor-element elementor-element-e3d4a8f elementor-widget elementor-widget-text-editor" data-id="e3d4a8f" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>This shows that the javascript code is in effect calculating (m/p) * m. We can see a similar method in UniVote, the code is found <a href="https://github.com/bfh-evg/univote2/blob/development/voting-client/src/main/webapp/js/univote-crypto.js#L589">here</a>:</p>						</div>
				</div>
				<div class="elementor-element elementor-element-684a519 elementor-blockquote--skin-border elementor-blockquote--button-color-official elementor-widget elementor-widget-blockquote" data-id="684a519" data-element_type="widget" data-widget_type="blockquote.default">
				<div class="elementor-widget-container">
					<blockquote class="elementor-blockquote">
			<p class="elementor-blockquote__content">
				var one = leemon.str2bigInt("1", 2, 1);<br>
var t1 = leemon.add(bigIntInZq, one);<br>
var t2 = leemon.powMod(t1, <br>encryptionSetting.q, encryptionSetting.p);<br>

if (leemon.equals(t2, one) == 1) {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return t1;<br>
} else {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    return leemon.sub(encryptionSetting.p, t1);<br>
}
			</p>
					</blockquote>
				</div>
				</div>
				<div class="elementor-element elementor-element-e407b7f elementor-widget elementor-widget-text-editor" data-id="e407b7f" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>As before, we’re adding 1 and then branching according to Euler’s criterion. Unlike above, in this case we have the value p – m instead of (1 x m). Since modular congruence can be achieved by subtraction[2], then this can be done.</p><p><i>-m mod p = (0 — m) mod p = p — m mod p</i></p><p>So both expressions, -m and p — m are equivalent, mapping the input m to quadratic residue.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-7d25d78e elementor-widget elementor-widget-heading" data-id="7d25d78e" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">Example Values
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-4df2cb99 elementor-widget elementor-widget-text-editor" data-id="4df2cb99" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Here we show some concrete encoding examples for small p. Let’s first print the values in G5 for a choice of safe prime 11 = (2 x 5) + 1.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-32faf00 elementor-widget elementor-widget-image" data-id="32faf00" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="800" height="120" src="/wp-content/uploads/2024/03/example0-1024x153.png" class="attachment-large size-large wp-image-2052" alt="" srcset="/wp-content/uploads/2024/03/example0-1024x153.png 1024w, /wp-content/uploads/2024/03/example0-300x45.png 300w, /wp-content/uploads/2024/03/example0-768x115.png 768w, /wp-content/uploads/2024/03/example0.png 1180w" sizes="(max-width: 800px) 100vw, 800px" />													</div>
				</div>
				<div class="elementor-element elementor-element-3525167 elementor-widget elementor-widget-text-editor" data-id="3525167" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>The quadratic residues are thus G5 = {1, 3, 4, 5, 9}. Now let’s see if the encoded in the allowed range q=5 actually map to residues.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-3fcdb83 elementor-widget elementor-widget-image" data-id="3fcdb83" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="800" height="170" src="/wp-content/uploads/2024/03/example1-1024x218.png" class="attachment-large size-large wp-image-2053" alt="" srcset="/wp-content/uploads/2024/03/example1-1024x218.png 1024w, /wp-content/uploads/2024/03/example1-300x64.png 300w, /wp-content/uploads/2024/03/example1-768x163.png 768w, /wp-content/uploads/2024/03/example1.png 1180w" sizes="(max-width: 800px) 100vw, 800px" />													</div>
				</div>
				<div class="elementor-element elementor-element-2ecbe75 elementor-widget elementor-widget-text-editor" data-id="2ecbe75" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>where we can see that the encoded values are indeed in G5. Let’s run another test for p = (2 x 11) + 1</p>						</div>
				</div>
				<div class="elementor-element elementor-element-d0ef20b elementor-widget elementor-widget-image" data-id="d0ef20b" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
													<img loading="lazy" decoding="async" width="800" height="302" src="/wp-content/uploads/2024/03/example2-1024x387.png" class="attachment-large size-large wp-image-2054" alt="" srcset="/wp-content/uploads/2024/03/example2-1024x387.png 1024w, /wp-content/uploads/2024/03/example2-300x113.png 300w, /wp-content/uploads/2024/03/example2-768x290.png 768w, /wp-content/uploads/2024/03/example2.png 1180w" sizes="(max-width: 800px) 100vw, 800px" />													</div>
				</div>
				<div class="elementor-element elementor-element-8bc005c elementor-widget elementor-widget-text-editor" data-id="8bc005c" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>Again, the encoding works.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-fac179f elementor-widget elementor-widget-heading" data-id="fac179f" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">In Summary
</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-93fdc80 elementor-widget elementor-widget-text-editor" data-id="93fdc80" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p>In this post we learned how ElGamal encrypts data by encoding it into the correct subgroup with the expression (m/p) x p, expressed as the legendre symbol. The properties of modular arithmetic also explain why this works. The Euler criterion was used to determine residuosity in two implementations of this technique. Last but not least, we examined some examples of subgroups and encodings for small p and q values.</p>						</div>
				</div>
				<div class="elementor-element elementor-element-5c04142 elementor-widget elementor-widget-heading" data-id="5c04142" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<h2 class="elementor-heading-title elementor-size-default">References</h2>		</div>
				</div>
				<div class="elementor-element elementor-element-4ab64dd elementor-widget elementor-widget-text-editor" data-id="4ab64dd" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
							<p><strong>[1] We are using two properties here</strong></p><ul><li aria-level="1">if a = b mod n, then <i>k a</i> = <i>k b</i> (mod <i>n</i>) for any integer <i>k</i> (compatibility with scaling)</li><li aria-level="1">if a* = b mod n, a<i>1 + *a</i>2 ≡ <i>b</i>1 + <i>b</i>2 (mod <i>n</i>) (compatibility with addition)</li></ul><p><strong>[2] Compatibility with subtraction,</strong></p><p>if <i>a1 = b1 mod n and a2 =  b2 mod n, *then</i> a<i>1 — *a</i>2 = <i>b</i>1 — <i>b</i>2 (mod <i>n</i>) (compatibility with subtraction)</p>						</div>
				</div>
				</div>
					</div>
				</div>
				</div>
		<p>The post <a href="/tech/plaintext-encoding-in-elgamal/">Plaintext Encoding in ElGamal</a> appeared first on <a href="/">Sequent</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
