<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abdussamet KACI on Medium]]></title>
        <description><![CDATA[Stories by Abdussamet KACI on Medium]]></description>
        <link>https://medium.com/@abdussamet.kaci?source=rss-f376e82c3941------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-uqRr0PfUfo7CGYbr9eCnA.jpeg</url>
            <title>Stories by Abdussamet KACI on Medium</title>
            <link>https://medium.com/@abdussamet.kaci?source=rss-f376e82c3941------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 14:44:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abdussamet.kaci/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[RSA vs EC Encryption: A High-Load Performance Comparison]]></title>
            <link>https://medium.com/dogus-tech-digital-solutions/rsa-vs-ec-encryption-a-high-load-performance-comparison-efeed73aa6f0?source=rss-f376e82c3941------2</link>
            <guid isPermaLink="false">https://medium.com/p/efeed73aa6f0</guid>
            <category><![CDATA[elliptic-curve]]></category>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[rsa]]></category>
            <category><![CDATA[performance-test]]></category>
            <dc:creator><![CDATA[Abdussamet KACI]]></dc:creator>
            <pubDate>Tue, 14 Nov 2023 08:32:22 GMT</pubDate>
            <atom:updated>2023-11-14T11:22:56.643Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*v53RzyttkDh-SDlKqhPh_Q.png" /></figure><p>Asymmetric encryption plays a vital role in securing data, and there are different algorithms available for this purpose. In this article, we’ll explore the performance differences between RSA (Rivest-Shamir-Adleman) and EC (Elliptic Curve) encryption algorithms through load testing.</p><h3>Load Testing with k6</h3><p>To perform these load tests, we’ve employed <a href="https://k6.io/">k6</a>, a powerful open-source load testing tool. We used k6 to measure the performance of RSA and EC encryption when generating and parsing tokens.</p><h3>Running the Tests</h3><p>To run the tests, you can follow these steps by using <a href="https://github.com/abdussametkaci/spring-security-asymmetric-encryption">source code</a>:</p><ol><li>Install k6.</li><li>Navigate to the “k6-load-test” folder.</li><li>Run the tests for RSA and EC encryption using the following commands:</li></ol><pre>cd k6-load-test<br><br>k6 run token-rsa.js</pre><p>All test scripts are located within the “k6-load-test” folder.</p><p>Our tests were conducted on a MacBook M2 Pro with 32GB of RAM, ensuring a reliable benchmark for comparison.</p><h3>Test Case</h3><p>During the load test, the number of users reaches 1000 within the first minute and requests start being sent. Then, for the next 2 minutes, 1000 users continue to send requests. Finally, in the last minute, the number of users drops to zero and the test concludes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*uVNso5SPmz5fNWpTeQwA4w.png" /><figcaption>Test Case</figcaption></figure><p>To generate token, requests are sent to ‘/token/rsa’ and ‘/token/ec’ enpoints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*wYUPdHTy_objSrA3JsR3xA.png" /><figcaption>Token Generation</figcaption></figure><p>To parse token claims, requests are sent to ‘/token/rsa/claims’ and ‘/token/ec/claims’ endpoints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*BvrjVYdob7BBOOfCV8DxoA.png" /><figcaption>Token Claim Parsing</figcaption></figure><p>In the tests, a 2048 bit long key was used for the RSA algorithm, while a 256 bit long key was used for the EC algorithm.</p><h3>Performance Analysis</h3><h4>RSA Encryption</h4><p><strong>Generating Tokens</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*NjvzknA59xffCGE5FaR4uw.png" /><figcaption>RSA Token Generation</figcaption></figure><p><strong>Parsing Token Claims</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*oQmvHsCUQRwr3jjI2gjmlA.png" /><figcaption>RSA Token Claims Parsing</figcaption></figure><h4>EC Encryption</h4><p><strong>Generating Tokens</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*mGP-usBptLggpBP6P_AgKA.png" /><figcaption>EC Token Generation</figcaption></figure><p><strong>Parsing Token Claims</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*kSeo6fx50_p0BJadkUVqBA.png" /><figcaption>EC Token Claims Parsing</figcaption></figure><h3>Comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zvp1Bir00Mxtp1FBTE3-mg.png" /><figcaption>Comparison of Algorithms</figcaption></figure><ul><li><strong>For a system that generates a large number of tokens:</strong> EC encryption is the more efficient choice due to its significantly higher performance when generating tokens.</li><li><strong>For a system that parses a large number of tokens:</strong> RSA encryption is the preferred option as it demonstrates better performance during token claims parsing.</li></ul><p>NOTE: When parsing tokens, both algorithms involve checking the signature, which is a crucial aspect of security.</p><h3>Conclusion</h3><p>The choice between RSA and EC encryption algorithms should be driven by your specific use case. Load testing can provide valuable insights into the performance characteristics of each algorithm, helping you make an informed decision to meet your security and efficiency requirements.</p><p>By understanding the strengths and weaknesses of RSA and EC encryption, you can optimize your system’s performance while ensuring robust data security.</p><h3>References</h3><ul><li><a href="https://k6.io/"><strong>k6</strong></a></li><li><a href="https://wiki.openssl.org/index.php/Elliptic_Curve_Cryptography"><strong>Elliptic Curve Cryptography — OpenSSL</strong></a></li><li><a href="http://koclab.cs.ucsb.edu/teaching/ecc/project/2015Projects/Levy.pdf"><strong>Elliptic Curve Cryptography: A Gentle Introduction</strong></a></li><li><a href="https://gist.github.com/gimbimloki/e73bb06fcf89a1ee3954885d5d9857dc"><strong>Sample Implementation of EC Encryption</strong></a></li><li><a href="https://mkjwk.org/"><strong>JSON Web Key Generator</strong></a></li></ul><p>For source code:</p><p><a href="https://github.com/abdussametkaci/spring-security-asymmetric-encryption">GitHub - abdussametkaci/spring-security-asymmetric-encryption: RSA vs EC Algoritms Load Test</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efeed73aa6f0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dogus-tech-digital-solutions/rsa-vs-ec-encryption-a-high-load-performance-comparison-efeed73aa6f0">RSA vs EC Encryption: A High-Load Performance Comparison</a> was originally published in <a href="https://medium.com/dogus-tech-digital-solutions">Doğuş Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka Auto Generated Documentation for Spring with Event-Catalog]]></title>
            <link>https://medium.com/dogus-tech-digital-solutions/kafka-auto-generated-documentation-for-spring-with-event-catalog-c5862b9e1ea9?source=rss-f376e82c3941------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5862b9e1ea9</guid>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[asyncapi]]></category>
            <category><![CDATA[kafka]]></category>
            <dc:creator><![CDATA[Abdussamet KACI]]></dc:creator>
            <pubDate>Tue, 14 Mar 2023 17:31:48 GMT</pubDate>
            <atom:updated>2023-03-31T06:23:58.456Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oJ-tbpkSjYGZ2gUDVfaq1w.png" /></figure><p>One of the best ways to understand the logic of a system’s operation is to read the documentation for that system. Especially for someone working in the software world, reading a document or preparing the document of the system you want to build is one of the indispensable jobs for you.</p><p>In this article, I will talk about a tool created for systems with event-driven architecture and how we use it in our current system.</p><h3>About the System</h3><p>Let’s say we are designing a sales application and this system is built using micro service architecture. There are 4 services in the system.</p><h4>Services</h4><ol><li>Backoffice:</li></ol><ul><li>Produce:<br>- CustomerCreatedEvent<br>- PaymentRegisteredEvent<br>- CustomerDeletedEvent</li></ul><p>2. Customer:</p><ul><li>Consume:<br>- CustomerCreatedEvent<br>- PaymentRegisteredEvent<br>- CustomerDeletedEvent</li></ul><p>3. Payment:</p><ul><li>Produce:<br>- RegisterQuantityDecreaseEvent</li><li>Consume:<br>- PaymentRegisteredEvent</li></ul><p>4. Stock:</p><ul><li>Consume:<br>- RegisterQuantityDecreaseEvent</li></ul><p>The system chart is as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7MhWnUWtJsiHO9KfdOjkpw.png" /><figcaption>The System</figcaption></figure><p>It will be very advantageous to show from which services these events are produced and consumed, with an interface and to use this as a document. We will use the tool called <a href="https://www.eventcatalog.dev/">Event-Catalog</a> for this.</p><blockquote>What is <a href="https://www.eventcatalog.dev/">Event-Catalog</a>?</blockquote><blockquote>Documentation tool for Event-Driven Architectures.</blockquote><blockquote><a href="https://www.eventcatalog.dev/">Event-Catalog</a> is an Open Source project that helps you document your events, services and domains.</blockquote><blockquote>Powered by markdown, components and plugins.</blockquote><p>Now here we can prepare documents for all services by creating markdowns in the format the tool wants. However, what if the system is very large and you have a lot of events? It can be costly to document it. In order to be more logical to create an auto-generating tool like <a href="https://swagger.io/">swagger</a>, how should we go about using this tool and having a tool that creates an automatic document?</p><p>First of all, when we examined the documentation of event-catalog, we discovered that it has a plugin called ‘<a href="https://www.eventcatalog.dev/docs/api/plugins/@eventcatalog/plugin-doc-generator-asyncapi">plugin-generator-asyncapi’</a>. This automatically generates the markdowns using <a href="https://www.asyncapi.com/">AsyncAPI</a> files and builds the documentation of our event-driven system.</p><blockquote>What is <a href="https://www.asyncapi.com/">AsyncAPI</a>?</blockquote><blockquote>Open-Source tools to easily build and maintain your event-driven architecture. All powered by the <a href="https://www.asyncapi.com/">AsyncAPI</a> specification, the industry standard for defining asynchronous APIs.</blockquote><h4>How to Create AsyncAPI Files?</h4><p>There are some tools for creating AsyncAPI files. Since we are using spring boot in our project, we found a tool called <a href="https://springwolf.github.io/">springwolf</a> which was produced for this. This tool automatically generates AsynAPI configs in json format in an endpoint for <a href="https://kafka.apache.org/">Kafka</a> or <a href="https://www.rabbitmq.com/">RabbitMQ</a>.</p><p>Instead of using this tool directly, we made use of this tool and rebuilt it to do our job. The reason we did this was because the tool only scanned the components in a base package. However, we preferred to keep producers and consumers in separate packages and did not want to change our package structure. In addition, while we can get data in json format at the endpoint opened by springwolf, we wanted to get yaml directly.</p><p>In other words, we wanted to customize it according to our own use. We have made a much simpler tool (<a href="https://github.com/DogusTeknoloji/springkafkadoc">springkafkadoc</a>) that we created by using springwolf.</p><h3>The Strategy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MrKtTbHCuKsWcKIkaDZwdw.png" /><figcaption>The Strategy of Automation Documentation Tool</figcaption></figure><p>Springkafkadoc tool is added to all projects and AsyncAPI yaml information is pulled from an endpoint by our event-catalog project. Then they are saved under a folder. Finally, the plugin is run and the project is launched.</p><h3>How to Use?</h3><ol><li>Apply the following configs to the build.gradle.kts file of all your spring projects</li></ol><pre>maven { url = uri(&quot;https://jitpack.io&quot;) }</pre><pre>implementation(&quot;com.github.DogusTeknoloji:springkafkadoc:1.0.4&quot;)</pre><p>2. Create configuration for base packages</p><pre>@Configuration<br>@EnableAsyncApi<br>class AsyncApiConfiguration {<br><br>    @Bean<br>    fun asyncApiDocket(): AsyncApiDocket {<br><br>        val info = Info.builder()<br>            .version(&quot;1.0.0&quot;)<br>            .title(&quot;Customer Service&quot;)<br>            .build()<br><br>        val kafkaServer = Server.builder()<br>            .protocol(&quot;kafka&quot;)<br>            .url(https://medium.com/BOOTSTRAP_SERVERS)<br>            .build()<br><br>        return AsyncApiDocket.builder()<br>            .consumerBasePackage(KAFKA_CONSUMER_BASE_PACKAGE)<br>            .producerBasePackage(KAFKA_PRODUCER_BASE_PACKAGE)<br>            .info(info)<br>            .server(&quot;kafka&quot;, kafkaServer)<br>            .build()<br>    }<br><br>    private companion object {<br>        const val BOOTSTRAP_SERVERS = &quot;0.0.0.0:9092&quot;<br>        const val KAFKA_CONSUMER_BASE_PACKAGE = &quot;your consumer package&quot;<br>        const val KAFKA_PRODUCER_BASE_PACKAGE = &quot;your producer package&quot;<br>    }<br>}</pre><p>3. Edit producers and consumers</p><pre>@Component<br>class CustomerCreatedEventConsumer {<br><br>    @KafkaListener(topicPattern = &quot;\${kafka.topics.customerCreated}&quot;)<br>    fun receive(@Payload payload: CustomerCreatedEvent) {<br>        // TODO<br>    }<br>}</pre><pre>@Component<br>class CustomerCreatedEventProducer {<br><br>    @AsyncApiDocProducer(&quot;customerCreated&quot;)<br>    fun send(@Payload payload: CustomerCreatedEvent) {<br>        // TODO<br>    }<br>}</pre><ul><li>Springkafkadoc:<br>- scan consumers and producers with <strong>@Component</strong><br>- scan models with <strong>@Payload</strong><br>- scan producers’ topics with <strong>@AsyncApiDocProducer</strong></li></ul><p>4. Finally, we will generate the document of all APIs by making some changes in the event-catalog tool</p><p>If you have not created an event-catalog project before, you can create it with the following command.</p><pre>npx @eventcatalog/create-eventcatalog@latest [name]<br><br>npx @eventcatalog/create-eventcatalog@latest event-catalog</pre><p>And, you can install the asyncapi generator plugin with the command.</p><pre>npm install --save @eventcatalog/plugin-doc-generator-asyncapi</pre><p>We created <strong>./async-api-yml-creator/index.js</strong> to fecth all AsyncAPI files from APIs and save to a folder (async-api-files).</p><pre>import fs from &quot;fs&quot;;<br>import axios from &quot;axios&quot;;<br><br>clearDir(&quot;./services&quot;)<br>clearDir(&quot;./events&quot;)<br>clearDir(&quot;.domains&quot;)<br>clearDir(&quot;./async-api-files&quot;)<br><br>const urls = [<br>  &quot;http://localhost:8080&quot;,<br>  &quot;http://localhost:8081&quot;,<br>  &quot;http://localhost:8082&quot;,<br>  &quot;http://localhost:8083&quot;<br>]<br><br>const baseUrls = urls.map(url =&gt; axios.create({ baseURL: url }))<br><br>for (const baseUrl of baseUrls) {<br>  const response = await baseUrl.get(&quot;/springkafkadoc/yaml&quot;);<br>  const url = baseUrl.defaults.baseURL<br>  fs.writeFileSync(`./async-api-files/${url.substring(url.lastIndexOf(&quot;/&quot;) + 1)}.yml`, response.data);<br>}<br><br><br>function clearDir(directory) {<br>  fs.rmSync(directory, { recursive: true, force: true });<br>  if (!fs.existsSync(directory)) {<br>    fs.mkdirSync(directory);<br>  }<br>}</pre><p>We edited <strong>eventcatalog.config.js</strong> file for running plugin and generating the markdown files. We added urls and passed files to <strong>pathToSpec</strong> parameter.</p><pre>const urls = [<br>  &quot;http://localhost:8080&quot;,<br>  &quot;http://localhost:8081&quot;,<br>  &quot;http://localhost:8082&quot;,<br>  &quot;http://localhost:8083&quot;<br>]<br><br>module.exports {<br>  // ...<br>  generators: [<br>    [<br>      &#39;@eventcatalog/plugin-doc-generator-asyncapi&#39;,<br>      {<br>        pathToSpec: urls.map(url =&gt; path.join(__dirname, `./async-api-files/${url.substring(url.lastIndexOf(&quot;/&quot;) + 1)}.yml`)),<br>        domainName: &quot;Spring Kafka Doc Demo&quot;,<br>        renderNodeGraph: true,<br>        versionEvents: false<br>      },<br>    ],<br>  ],<br>  // ...</pre><p>We added scripts to <strong>package.json</strong> for generating yamls.</p><pre>&quot;scripts&quot;: {<br>  &quot;get-yamls&quot;: &quot;node ./async-api-yml-creator/index.js&quot;<br>}</pre><p>After doing all this, you can run the event catalog application by running the commands below. (Here we assume that all backend applications are up)</p><pre>npm run get-yamls<br>npm run generate <br>npm run build <br>npm run start</pre><h4>Result</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UQV2TH2kYQvdJyHmdfxSRg.png" /><figcaption>Events</figcaption></figure><h3>References</h3><ul><li><a href="https://www.eventcatalog.dev/">https://www.eventcatalog.dev/</a></li><li><a href="https://www.asyncapi.com/">https://www.asyncapi.com/</a></li><li><a href="https://springwolf.github.io/">https://springwolf.github.io/</a></li></ul><p>You can use the links below to access the source codes for the tool we developed and the sample we created.</p><ul><li><a href="https://github.com/DogusTeknoloji/springkafkadoc">GitHub - DogusTeknoloji/springkafkadoc: Auto Generated Kafka Documentation for Spring Boot</a></li><li><a href="https://github.com/DogusTeknoloji/springkafkadoc-example">GitHub - DogusTeknoloji/springkafkadoc-example: This repository serves as a guide for combining the documentation for spring kafka and event catalog for documenting asynchronous calls.</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5862b9e1ea9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dogus-tech-digital-solutions/kafka-auto-generated-documentation-for-spring-with-event-catalog-c5862b9e1ea9">Kafka Auto Generated Documentation for Spring with Event-Catalog</a> was originally published in <a href="https://medium.com/dogus-tech-digital-solutions">Doğuş Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>