Jekyll2023-10-30T20:16:08+00:00https://daveeargle.com/feed/professional.xmlDave Eargle | ProfessionalPersonal website of David EargleDavid EargleHiring a Consultancy vs Running a Bug Bounty Program2022-09-14T00:00:00+00:002022-09-14T00:00:00+00:00https://daveeargle.com/2022/09/14/timeboxed-assesssments<p>A company may be choosing between hiring an information security consultancy, or running a public “bug bounty” program. This post compares those two options. Warning: I’m still relatively new to working in a consultancy, so my thoughts on this may be immature.</p>
<h2 id="running-a-bug-bounty-program-goals-and-characteristics">Running a bug-bounty program: Goals and Characteristics</h2>
<p>A company that runs a bug bounty program might have goals that include the following:</p>
<ol>
<li>Actually improve the security of products. Discover and patch vulnerabilities in products that might <em>already be in production</em>.</li>
<li>Weaken the vulnerability black-market by providing an acceptable-to-the-company outlet for security researchers to get paid for finding and reporting vulnerabilities.</li>
<li>Make public claims about having a bug bounty programs. Ostensibly, a platform or product with a bug bounty program will be more secure than one without such a program – it’s the open-source idea of many eyes leading to few bugs.<sup id="fnref:specious_logic" role="doc-noteref"><a href="#fn:specious_logic" class="footnote" rel="footnote">1</a></sup></li>
</ol>
<p>Bug-bounty program characteristics include the following:</p>
<ul>
<li>Consultants are paid based on the <em>number</em> and <em>type</em> of vulnerabilities they find – consultants are not paid for their time.</li>
<li>Findings have to be vetted by the client before payment is made.</li>
<li>Clients <em>do not (necessarily) care</em> about maintaining long-term relationships with researchers or consultants.</li>
</ul>
<h2 id="hiring-an-information-security-consultancy-goals-and-characteristics">Hiring an information security consultancy: Goals and Characteristics</h2>
<p>Client goals might include the following:</p>
<ol>
<li>Actually improve the security of products. Discover and patch vulnerabilities <em>before</em> moving to production; perform assessments in a sandbox environment.</li>
<li>Get a “clean bill of health” from an approved consultancy vendor. Approved-vendor lists perhaps come from cybersecurity insurance providers, from acquisition partners, or from boards-of-directors.</li>
</ol>
<p>Information security consultancy characteristics include the following:</p>
<ul>
<li>Payment is for a fixed amount, and is not based on the number of vulnerabilities found, but rather, for the time consultants spend searching for vulnerabilities.</li>
<li>A company that hires a consultancy doesn’t <em>just</em> have a goal of <em>finding</em> and <em>patching</em> vulnerabilities. Above this, it is to also get a “bill of clean health” from a consultant or consultant-group – specifically, from one with a <em>good reputation</em>.</li>
<li>Information security consultancies are motivated to maintain <em>long-term business relationships</em> with clients.</li>
</ul>
<h2 id="what-determines-the-reputation-of-a-consultancy">What determines the reputation of a consultancy?</h2>
<p>This is a chonky topic! For now, just consider that while reputation is a proxy for expertise, not all methods that determine reputation require actually evaluating expertise.</p>
<p>Some reputation-evaluation methods:</p>
<ul>
<li>Referrals</li>
<li>Technical evaluations of previous reports</li>
<li>Technical evaluations of public presentations by consultants from the consultancy</li>
<li>Technical evaluations of public tools released by consultants</li>
<li>Blog posts published by the consultancy</li>
<li>Consultancy certificate-counting
<ul>
<li>includes ones such as CISSP, CEH, Security+, or ones from cloud-computing providers such as AWS, GCP, and Azure. Prospective clients might explicitly ask a consultancy whether and how many of a prospective vendor’s consultants have these certifications. Certificates are arguably more important for cold-call relationships between vendors and clients, in the absence of referrals.</li>
</ul>
</li>
</ul>
<p>Ones that I think are less worthwhile:</p>
<ul>
<li>Impressions of consultancy website, advertisements, testimonials.</li>
</ul>
<p>Some random thoughts:</p>
<ul>
<li>
<p>The success of a security assessment consultancy practice, and the value of its assessments to clients, depends on the strength of a consultancy’s reputation for <em>being able</em> to find vulnerabilities, including ones that are <em>hard to find</em>.</p>
</li>
<li>
<p>Arguably, the quality of referrals and of a previous assessment-reports can be easier to evaluate and are more valuable than certifications-counting, depending on the strength and quality of the referral, or on the cybersecurity technical expertise of the prospective client reviewing the assessment.<sup id="fnref:students_gpa_vs_referral" role="doc-noteref"><a href="#fn:students_gpa_vs_referral" class="footnote" rel="footnote">2</a></sup></p>
</li>
<li>
<p>In either case – with either bug-bounty programs or hiring a consultancy – what a company ultimately obtains in the best-case scenario is the ability to say: “These assessors couldn’t break this product”. Whether that’s an impressive claim depends largely on the (perceptions of) expertise of the assessors. And that is why the reputation of the “we” in a consultancy is so important; it is a proxy for the expertise of the consultants. A reputation is knowable even by persons unqualified to directly assess the expertise of a consultancy’s consultants.<sup id="fnref:do_not_roll_your_own_meta" role="doc-noteref"><a href="#fn:do_not_roll_your_own_meta" class="footnote" rel="footnote">3</a></sup>a</p>
</li>
</ul>
<h2 id="hiring-a-consultancy-lets-a-company-control-the-value-of-its-security-assessments">Hiring a consultancy lets a company control the value of its security assessments</h2>
<p>For <strong>both</strong> the client and <strong>also</strong> for whomever the client is trying to impress, the <em>perception of expertise</em> – or the <em>reputation</em> of the vendor-consultancy – is very important. It’s arguably more important than a consultancy’s <em>actual</em> expertise<sup id="fnref:scandalous" role="doc-noteref"><a href="#fn:scandalous" class="footnote" rel="footnote">4</a></sup>. But the decision of which vendors have a sufficiently good reputation may not be up to the entity whose product is being assessed. Rather, an interested <strong>someone else</strong> makes the decision about which vendors have a good-enough expertise. And that third-party is probably making that decision based on the vendors’ reputations.</p>
<p>But a <strong>key point</strong> is this: no such vendor-selection control is possible with a bug bounty program, so any company that needs to have an assessment performed by a vendor with a certain minimum expertise/reputation <em>must</em> specifically hire a consultancy, whether from an approved vendor list, or whether of their own choice.</p>
<hr />
<p>PS: :wave: I quit academia and joined <a href="https://carvesystems.com">Carve Systems</a>, a cybersecurity consultanty! I’m having a great time. See also <a href="/2022/09/13/finding-lifecycle/">this recent blog post</a>.</p>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:specious_logic" role="doc-endnote">
<p>Whether that questionable logic holds is outside the scope of this article. <a href="#fnref:specious_logic" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:students_gpa_vs_referral" role="doc-endnote">
<p>This is similar to a student trying to get their first job in an industry. Prospective employers can review external signals such as their GPA’s or test scores. Or they can rely on a referral. Or an evaluation of the candidate’s internship performance. (Hopefully it was a paid internship!) Employers probably prefer referrals over GPAs. They probably prefer internship evaluation most of all – a self-referral, as it were – but the candidate would prefer to skip straight to getting paid well. If the candidate is worth it, the employer probably prefers hiring them right away, too. Because speed is better for business. <a href="#fnref:students_gpa_vs_referral" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:do_not_roll_your_own_meta" role="doc-endnote">
<p>This is related to why a company should not “roll their own crypto” – because “anyone is smart enough to write a cryptography algorithm that they themselves cannot break,” loosely quoting <a href="https://www.schneier.com/crypto-gram/archives/1998/1015.html#cipherdesign">https://www.schneier.com/crypto-gram/archives/1998/1015.html#cipherdesign</a>. Consider: NIST hosts cybersecurity competitions that bring together ostensibly the world’s best cryptographers and cryptanalysts to try to find vulnerabilities in each other’s ciphers. Even for them, the best claim that they can make is, “we weren’t smart enough to break it, and we know lots of ways to break these kinds of things.” They cannot, and I think do not say, “this cipher is objectively unbreakable.” Ultimately, who’s to say that there’s not a shadowy expert sequestered in an elite shadowy government entity building who can and has already broken it? Still, industry does the best it can. <a href="#fnref:do_not_roll_your_own_meta" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:scandalous" role="doc-endnote">
<p>But it’s scandalous to suggest that the perception of expertise is possible without actual expertise, because the former will catch up to the latter eventually. But it <em>is</em> possible, unlaughably so, or at least I can imagine, a situation where there is <em>actual</em> expertise, but the <em>perception</em> of expertise isn’t there. This would be unfortunate, and would require interventions like “self-marketing” and “impression management”, which aren’t the focus of this post. <a href="#fnref:scandalous" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>David EargleA company may be choosing between hiring an information security consultancy, or running a public “bug bounty” program. This post compares those two options. Warning: I’m still relatively new to working in a consultancy, so my thoughts on this may be immature.What happens to a security-assessment finding?2022-09-13T00:00:00+00:002022-09-13T00:00:00+00:00https://daveeargle.com/2022/09/13/finding-lifecycle<p>I originally wanted to publish this on the company blog, until I realized that company blogs are for <em>assertive statements of reality</em> as opposed to missives about professional growth and realizations. So this post is coming here instead!</p>
<p>I’m replacing the company name with <code class="language-plaintext highlighter-rouge">Firm</code>, not because it’s confidential, but because the company might not want posts like these to come in up SEO for them.</p>
<p>Oh and I left academia back in June and joined an information security consulting group. Having so much fun.</p>
<hr />
<p><em>This article is philosophical musings on writing a vulnerability finding for a security assessment report. The author is as of time of publication one of <code class="language-plaintext highlighter-rouge">Firm</code>’s Senior Consultants. He recently moved into cybersecurity consulting during the Great Resignation, coming from a 10-year career in academia, in business schools, where he researched and taught cybersecurity management.</em></p>
<p>When I moved into the cybersecurity consulting industry from academia and started working at <code class="language-plaintext highlighter-rouge">Firm</code>, I had to learn how to <em>write a security assessment report</em>. This was an entirely different skill for me from <em>performing the technical work</em> of a security assessment. A light-bulb moment was when I learned how the reports would be <em>used</em>. This post describes what I learned. It may be insightful to current or prospective clients, or to new consultants in the industry.</p>
<p><strong>Key takeaways:</strong></p>
<ul>
<li>View each finding as a separate <em>ticket</em>. An <em>issue</em>. A bug tracker item. Because that might be <em>exactly</em> what the finding turns into once delivered to the client.</li>
<li>A report’s findings have lifecycle stages: Creation, Delivery, Support, and Retesting.</li>
</ul>
<h2 id="creation-stage">Creation Stage</h2>
<p>My notes below on the “creation” stage aren’t comprehensive. I raise points relevant to the lifecycle stages discussions following this section.</p>
<ul>
<li>Finding “creation” is analogous to “opening an issue” in a source code management repository.</li>
<li>Each finding may be <em>one vulnerability</em>, or a <em>collection of related vulnerabilities</em>.
<ul>
<li>How and whether vulnerabilities get grouped into a single finding is subjective. For example, three overly permissive cloud buckets could all be grouped into one finding, while two different kinds of authentication bypass should probably each get their own finding. It might depend on what kind of work the consultant envisions the client will need to do to <em>close</em> the issue on their end.</li>
</ul>
</li>
<li>A finding should include things like the following:
<ul>
<li><strong>Impact statement:</strong>
<ul>
<li>A <em>specific business risk</em> realized by a <em>vulnerability</em> within a client <em>asset</em>.</li>
<li>Should be punchy. Probably one sentence. Might be presented word-for-word by the consultant in a read-out call with the client in the “delivery” stage, to introduce the finding.</li>
<li>For example, “An attacker can completely take over accounts merely by guessing easily enumerated device serial numbers.”</li>
</ul>
</li>
<li><strong>Details:</strong>
<ul>
<li>A finding should have sufficient detail to permit (1) the author-consultant, or (2) another consultant, or (3) the client, to replicate and con<code class="language-plaintext highlighter-rouge">Firm</code> the finding. Proofs-of-concept.
<ul>
<li>Consultant-authors should keep all three audiences in mind! Consultants, be kind to your future selves. You or a colleague may have to read this section <em>months</em> from now if and when you perform another security assessment for this client.</li>
<li>The client will need to be able to replicate the finding so that they can con<code class="language-plaintext highlighter-rouge">Firm</code> for themselves that it does indeed exist. This doesn’t just support the consultant’s finding’s claim – it also helps the client <em>fix</em> the vulnerability.</li>
</ul>
</li>
<li>Should include detailed evidence <em>in the report</em> demonstrating the finding.
<ul>
<li>If the client’s code base changes after the initial discovery of the finding but before the report delivery, the consultant might not be able to go back later and get the evidence again.</li>
<li>Should include things like screenshots, code blocks, and raw (and redacted!) HTTP requests and responses. What gets included will depend on what is being assessed (e.g., webapp? mobile device? API?).</li>
<li>A fellow consultant could <em>learn</em> from the report, perhaps months later. Consider the educational opportunity.</li>
<li>The quality of the finding details writeup serves as an attestation to the quality of the consultant’s and the consultancy’s work. It may be a future calling-card for new client engagements.
<ul>
<li>Maybe the report is <em>so good</em> that it gets passed around between business units within the organization.</li>
</ul>
</li>
<li>The details should be <em>direct</em>, yet <em>kind</em>. Kind as in, not <em>mean</em>. Not offensive. But direct as in, factual and assertive. Kind, because someone or some team wrote the code. Critique the <em>code</em>, but leave out character attacks on the code author; they have no place in a report paid for and delivered to a client.<sup id="fnref:academic_critique" role="doc-noteref"><a href="#fn:academic_critique" class="footnote" rel="footnote">1</a></sup></li>
</ul>
</li>
</ul>
</li>
<li><strong>Classifications:</strong>
<ul>
<li>Using agreed-upon <a href="https://softwareengineering.stackexchange.com/questions/232425/what-is-the-process-of-creating-a-bug-bar">bug bars</a>, the finding should be <em>classified</em>. What is its severity? Ease of exploitation? Does it impact system confidentiality, integrity, availability? Authentication and/or authorization? Etc. What gets classified and how it is done may depend on the client’s needs, because finding classifications may have serious client business implications.</li>
</ul>
</li>
<li><strong>Recommendations:</strong>
<ul>
<li>Cybersecurity consultancies are hired to <em>break</em> code for clients, not to <em>make</em> code for them.
<ul>
<li>Therefore, at the <em>bare minimum</em>, a recommendation should be the lexical equivalent of a programming <a href="https://en.wikipedia.org/wiki/Unit_testing">unit test</a> assertion – a statement of what needs to be <em>true</em> in order for the vulnerability to be considered “mitigated.” When is it “fixed”?
<ul>
<li>For example, “The <code class="language-plaintext highlighter-rouge">/foobar</code> route should authenticate requests,” or, “The <code class="language-plaintext highlighter-rouge">id</code> parameter in the <code class="language-plaintext highlighter-rouge">/baz</code> route should be sanitized – it should not allow arbitrary SQL code execution.”</li>
<li>Imagine literally writing a unit test – what would need to be true for it to pass?</li>
</ul>
</li>
</ul>
</li>
<li>Even though a consultant is hired to <em>hulk smash</em> (within contractual limits!), consultants should strive to offer actionable advice and helpful resources to clients.
<ul>
<li>For example, consultants could point the client to well-reputed online guides for remediating vulnerabilities, such as one of the <a href="https://cheatsheetseries.owasp.org/IndexTopTen.html">OWASP Cheat Sheets</a>. Or for outdated software, links to recommended and currently up-to-date versions.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 id="delivery-stage">Delivery Stage</h2>
<p>Illustrated with a story.</p>
<p>The first project I worked on delivered the final report to the client-contact at the end of the contract’s assessment calendar-window. A week later, a “read-out” call was scheduled with the client, and also with 12 (too many!) other engineers from the outsourced client company whose app we had assessed. During the call, my colleagues and I took turns “presenting” findings from our report, with the report visible on a shared screen. One finding at a time. We entirely skipped the introductory and methodology sections of the report, per the client’s request. For a finding, we typically led with reading the impact statement aloud. Then we summarized succinctly what we had done to find it, and what we had exploited to find it.</p>
<p>The client would ask for clarification, and then deliberate internally, identifying which piece of their code base (invisible to us, for this engagement) was responsible. And a few times I heard the phrase that led to my light-bulb moment, one client to another:</p>
<blockquote>
<p>This finding is ID <code class="language-plaintext highlighter-rouge">123</code> within the <code class="language-plaintext highlighter-rouge">issue tracking system.</code></p>
</blockquote>
<p>Before the call, someone on the client engineering team had, within their tracking system, opened one ticket for each one of our findings, and had copy-and-pasted the details and recommendation section into there. (They had actually requested from us an Archer-format spreadsheet of our findings, which was essentially the same thing). During the call, they assigned each finding-issue to a team member, using their issue tracking system.</p>
<p>So at that point, the finding from the Creation stage took on a life of its own, as all issues within a tracking system do.</p>
<p>Possibly though, one of our findings had been tenuous. As in, we weren’t certain there actually was a vulnerability, but we had documented it for sake of being thorough. For example, “The request to submit an order appears to accept arbitrary purchase amounts. We cannot tell what price is actually being charged on the back end. If the arbitrary price is ignored, we will update this finding and close it.” After reading aloud which, on the call, the client might attest on the spot that, indeed, the client-provided price is ignored, and we would add a note to the finding stating their attestation, and close the finding. Or they would make a note to look into it, and then close or escalate it on their own time, until we saw it again during the Retest lifecycle stage.</p>
<p>Another phrase I heard repeated a few times was, one engineer to another, “Where is this report? I need these details [so I can close or work on the vuln].” A common response was, “The finding details are already in the tracking system. I can send the full PDF to you via [some internal secure messaging system] later.” My impression was that the PDF might not ever complete that journey. But to the client team, it didn’t matter. They had already copied the finding into the tracking system.</p>
<p>The problem was, my findings documents didn’t stand alone – for example, one finding had cross-references to lengthy domain names that I wrote out in a table in the methodology section.</p>
<p>I should have written each finding to be stand-alone. For this client, anyway.</p>
<h2 id="support-and-retest-stages">Support and Retest Stages</h2>
<p><code class="language-plaintext highlighter-rouge">Firm</code>’s contracts with clients typically specify one retest within <code class="language-plaintext highlighter-rouge">n</code> days from report delivery, bundled into the price of the overall assessment contract.</p>
<p>Many clients are interested not just in receiving a <em>bill of health</em> from a cybersecurity consultancy, but specifically, in receiving a <em>bill of <strong>good</strong> health</em>. Like how children need a physical to go to summer camp. Not just <em>a</em> physical though, but a <em>passing</em> one. The client needs one, perhaps so they can get their app deployed. The client wants the findings <em>closed</em> – specifically, attested to <em>by the consultancy</em> that the findings are closed. This is why the unit-test-style recommendations findings sections are important. With those, the client knows what they need to do for the consultancy to give a passing score.</p>
<p>Occasionally, we also had some back-and-forth communication – support – with the client via email about findings in-between report delivery and the formal beginning of the retest. I consider this part of the Retest stage.</p>
<p>Continuing the story: For the retest, the client provided us with a list of all of our findings along with their notes about whether they had closed the finding’s vulnerability – or at least, with whether the client <em>thought</em> they had closed it. During retest, we verified for ourselves whether a finding was closed (where possible). If we couldn’t verify that ourselves, we added a note to the top of each finding, recording the client’s attestation about why the finding should be closed, and that we were closing it on the basis of the attestation.</p>
<p>After retest completion, we provided an updated version of our original report, with remediated findings updated with a <code class="language-plaintext highlighter-rouge">RETESTED/CLOSED</code> status. Or others with a <code class="language-plaintext highlighter-rouge">RETESTED/OPEN</code> status, but an explicit note about conversations we had had with the client about what they had done, and what they had left to do. Like perhaps their fix was dependent on yet another business unit or external vendor. Our updated retest report included a nice table at the very top of the report with just the “HIGH”- or “CRITICAL”-severity findings, most of which had a strike-through after the retest, indicating, “<code class="language-plaintext highlighter-rouge">Firm</code> initially identified some vulnerabilities in this app, but [client] fixed all of them to our satisfaction.” Which meant that the particular client business unit was cleared to deploy their app to production, whereas otherwise they might have been blocked until the Highs and Criticals were mitigated, according to this client’s organizational protocols.</p>
<p>Business moving forward is a good outcome for everyone. The hackers get to break stuff, and then see the satisfaction of their work not ignored. And the client gets their bill of good health.</p>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:academic_critique" role="doc-endnote">
<p>This can be tricky, but I saw some of it in reading academic paper reviews, in my previous job. An <em>objective and direct</em> paper review might say, “This paper has the following fatal flaws.” That’s fine – for the sake of science, work must be critiqued. But it is <em>totally</em> not necessary to go beyond, and to attack the author. <strong>Don’t do the following!:</strong> “This paper is crap, and <em>the author</em> is a bad scientist who should feel bad, and quit their job.” This is a character attack! It’s unprofessional. It’s not necessary. It doesn’t help science. There’s niche situations in academia where focusing on the author <em>might</em> be important, such as in cases of scientific fraud, but those aren’t relevant to this post. <a href="#fnref:academic_critique" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>David EargleI originally wanted to publish this on the company blog, until I realized that company blogs are for assertive statements of reality as opposed to missives about professional growth and realizations. So this post is coming here instead!ThingsOnEdge Cricket IoT Moisture Sensor with Home Assistant2022-04-06T00:00:00+00:002022-04-06T00:00:00+00:00https://daveeargle.com/2022/04/06/cricket-moisture-sensor-home-assistant<p class="lead">My first foray into IoT soil moisture sensing. Describes calibrating a moisture sensor, connecting it to a Cricket IoT esp32 board, and receiving mqtt moisture readings on Home-Assistant.</p>
<p>This post isn’t very interesting narrative-wise. My intention is to document
some of the different pieces and configurations I stitched together to get this
project sort-of working. When I was learning about these things, I remember
wanting moar photos and moar implementation details. So here goes.</p>
<p>If there’s a part you’d
like more details on, open an issue on github (link at the bottom of this page)
or send me an email, and I’ll queue it.</p>
<hr />
<p>I got a handful of <a href="https://www.thingsonedge.com/product-page/wifi-cricket">ThingsOnEdge Cricket IoT Wi-Fi devices</a>.</p>
<div class="">
<a href="/assets/img/electrical-engineering/iot-cricket-a929dc_58e9c602eda04755874b28732e29c4b5_mv2.webp" target="_blank">
<img src="/assets/img/electrical-engineering/iot-cricket-a929dc_58e9c602eda04755874b28732e29c4b5_mv2.webp" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="ThingsOnEdge Cricket" />
</a><p class="fw-lighter fst-italic">Image from <a href="https://www.thingsonedge.com/product-page/wifi-cricket">ThingsOnEdge Cricket product page</a></p></div>
<p>I also got some capacitive soil moisture sensors. I painted the top and sites with clear nail polish.</p>
<div class="">
<a href="/assets/img/electrical-engineering/gikfun-capacitive-soil-moisture-sensor-715O9pxH36L._AC_SX679_.jpg" target="_blank">
<img src="/assets/img/electrical-engineering/gikfun-capacitive-soil-moisture-sensor-715O9pxH36L._AC_SX679_.jpg" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="GikFun Soil Moisture Probe" />
</a><p class="fw-lighter fst-italic">Image from <a href="https://www.amazon.com/Gikfun-Capacitive-Corrosion-Resistant-Detection/dp/B07H3P1NRM">Amazon store listing</a></p></div>
<p>I connected these to IO2 on the Cricket, and configured the cricket to read these as (digital/analog). Post via MQTT to a local broker (see my broker Docker config <a href="https://github.com/deargle/my-mosquitto">on github</a>).</p>
<div class="">
<a href="/assets/img/electrical-engineering/toe-cricket-config-soil-moisture.png" target="_blank">
<img src="/assets/img/electrical-engineering/toe-cricket-config-soil-moisture.png" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="Config for ThingsOnEdge Cricket as soil moisture probe" />
</a><p class="fw-lighter fst-italic">Config for ThingsOnEdge Cricket as soil moisture probe</p></div>
<p>Calibrated the sensor by baking a sample of our soil at ~200 degrees fahrenheit
until totally dry. Got IO2 readings directly from the MQTT broker for totally dry soil (93) and for sopping-wet soil (52). The IO2 readings is a representation of the ratio of the analog input voltage against the Cricket’s reference voltage of 3.5V. The ratio is scaled by the configured resolution – 8 bits, in my case – so that the max IO2 value is 255. The formula is: <code class="language-plaintext highlighter-rouge">Vin = (Vref / 2**resolution) * IO2</code></p>
<p>In my case, my IO2 reading of 93 came from an analog voltage reading of 1.27V, and my reading of 52 came from a reading of 0.71V. (see explanation <a href="https://docs.google.com/document/d/e/2PACX-1vSLMmeT7LHo52Tu5rUoHpomhnLPz2Lr2JFKQCZevg8mKUv2M87bdbqb_7Al5pN9mxoxY2aqX-CRyLHk/pub#h.xg3xi622kjgx">in the cricket docs</a>)</p>
<div class="">
<a href="/assets/img/electrical-engineering/2021-12-29-soil-calibration-air.jpg" target="_blank">
<img src="/assets/img/electrical-engineering/2021-12-29-soil-calibration-air.jpg" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="calibrate-air" />
</a><p class="fw-lighter fst-italic">IO2 readings for air stabilized at 94</p></div>
<div class="">
<a href="/assets/img/electrical-engineering/2021-12-29-soil-calibration-baked-soil.jpg" target="_blank">
<img src="/assets/img/electrical-engineering/2021-12-29-soil-calibration-baked-soil.jpg" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="calibrate-baked-soil" />
</a><p class="fw-lighter fst-italic">IO2 readings for baked soil stabilized at 93</p></div>
<div class="">
<a href="/assets/img/electrical-engineering/2021-12-29-soil-calibration-sopping-wet-soil.jpg" target="_blank">
<img src="/assets/img/electrical-engineering/2021-12-29-soil-calibration-sopping-wet-soil.jpg" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="calibrate-sopping-wet-soil" />
</a><p class="fw-lighter fst-italic">IO2 readings for sopping wet soil stabilized at 52</p></div>
<p>Configure Home-Assistant to read the posted MQTT io2 values. Configured a
<a href="https://www.home-assistant.io/integrations/compensation/">Compensation integration</a> to scale the dry/wet readings to 0/100%.</p>
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">sensor</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="na">name</span><span class="pi">:</span> <span class="s">cricket8_moisture</span>
<span class="na">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">/cricket8/io2"</span>
<span class="na">compensation</span><span class="pi">:</span>
<span class="na">cricket8_moisture_compensation</span><span class="pi">:</span>
<span class="na">unique_id</span><span class="pi">:</span> <span class="s">cricket8_moisture_compensation</span>
<span class="na">source</span><span class="pi">:</span> <span class="s">sensor.cricket8_moisture</span>
<span class="na">unit_of_measurement</span><span class="pi">:</span> <span class="s1">'</span><span class="s">%'</span>
<span class="na">data_points</span><span class="pi">:</span>
<span class="pi">-</span> <span class="pi">[</span><span class="nv">93</span><span class="pi">,</span> <span class="nv">0</span><span class="pi">]</span>
<span class="pi">-</span> <span class="pi">[</span><span class="nv">52</span><span class="pi">,</span> <span class="nv">100</span><span class="pi">]</span>
</code></pre></div></div>
<p>Configured a <a href="https://www.home-assistant.io/integrations/plant/"><code class="language-plaintext highlighter-rouge">plant</code> component</a>, which also displays battery and temperature readings
from the cricket.</p>
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">plant</span><span class="pi">:</span>
<span class="na">cricket8_plant</span><span class="pi">:</span>
<span class="na">sensors</span><span class="pi">:</span>
<span class="na">moisture</span><span class="pi">:</span> <span class="s">sensor.compensation_sensor_cricket8_moisture</span>
<span class="na">battery</span><span class="pi">:</span> <span class="s">sensor.cricket8_battery</span>
<span class="na">temperature</span><span class="pi">:</span> <span class="s">sensor.cricket8_temp</span>
</code></pre></div></div>
<div class="">
<a href="/assets/img/electrical-engineering/home-assistant-plant.png" target="_blank">
<img src="/assets/img/electrical-engineering/home-assistant-plant.png" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="home-assistant-dashboard-plant-component" />
</a><p class="fw-lighter fst-italic">A simple dashboard entry created by the Plant component showing reported soil moisture, temperature, and battery.</p></div>
<p>Dropped a small aquarium pump like <a href="https://www.ebay.com/itm/224647580427">this one from ebay</a> into the watering can, and connected drip line from
it to emitters in the top of the plant tower. Plugged the pump into a <a href="https://sonoff.tech/product/smart-plug/s31-s31lite/">Sonoff S31
wifi outlet switch</a>.</p>
<div class="">
<a href="/assets/img/electrical-engineering/2022-02-25-cricket-moisture-with-pump.jpg" target="_blank">
<img src="/assets/img/electrical-engineering/2022-02-25-cricket-moisture-with-pump.jpg" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="Drip-line pump" />
</a><p class="fw-lighter fst-italic">Podunk irrigation is podunk.</p></div>
<p>Flashed tasmota on the switch, connected it to home-assistant via MQTT. The
below image shows flashing a Wyze plug. These were really hard to open! I recommend the sonoffs over these.</p>
<div class="">
<a href="/assets/img/electrical-engineering/2021-12-01-wyze-flash-tasmota.jpg" target="_blank">
<img src="/assets/img/electrical-engineering/2021-12-01-wyze-flash-tasmota.jpg" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="flashing a wyze" />
</a><p class="fw-lighter fst-italic">Using the tasmota web flasher on a Wyze smart plug.</p></div>
<p>Rammed the sensor into the soil, <a href="https://www.milliput.com/">Milliput</a> putty holding things together.</p>
<div class="">
<a href="/assets/img/electrical-engineering/2021-12-29-cricketmoisture-v1.jpg" target="_blank">
<img src="/assets/img/electrical-engineering/2021-12-29-cricketmoisture-v1.jpg" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="raw-probe-in-soil" />
</a></div>
<p>Then I got nervous about accidentally watering
the Cricket, so I made a lego case. I don’t have a 3d-printer!</p>
<div class="">
<a href="/assets/img/electrical-engineering/2022-03-17-cricket-moisture-1.jpg" target="_blank">
<img src="/assets/img/electrical-engineering/2022-03-17-cricket-moisture-1.jpg" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="lego-probe-case" />
</a></div>
<div class="">
<a href="/assets/img/electrical-engineering/2022-03-17-cricket-moisture-2.jpg" target="_blank">
<img src="/assets/img/electrical-engineering/2022-03-17-cricket-moisture-2.jpg" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="lego-probe-case" />
</a></div>
<div class="">
<a href="/assets/img/electrical-engineering/2022-03-17-cricket-moisture-3.jpg" target="_blank">
<img src="/assets/img/electrical-engineering/2022-03-17-cricket-moisture-3.jpg" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="lego-probe-case" />
</a></div>
<div class="">
<a href="/assets/img/electrical-engineering/2022-03-17-cricket-moisture-4.jpg" target="_blank">
<img src="/assets/img/electrical-engineering/2022-03-17-cricket-moisture-4.jpg" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="lego-probe-case" />
</a></div>
<div class="">
<a href="/assets/img/electrical-engineering/2022-03-17-cricket-moisture-5.jpg" target="_blank">
<img src="/assets/img/electrical-engineering/2022-03-17-cricket-moisture-5.jpg" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="lego-probe-case" />
</a></div>
<p>At one point, I set up Node-RED to do Proportional Integral Derivative (PID) to keep the soil at a target moisture. I was using <a href="https://flows.nodered.org/node/node-red-contrib-pid"><code class="language-plaintext highlighter-rouge">node-red-contrib-pid</code></a> and <a href="https://flows.nodered.org/node/node-red-contrib-timeprop"><code class="language-plaintext highlighter-rouge">node-red-contrib-timeprop</code></a>
But the emitters flow rate was too high for the soil – the soil wasn’t retaining moisture long enough for it to disperse out, so the base of the tower was flooding. I put automatic watering on the project back-burner, but the sensors are still in.</p>
<hr />
<p>Bonus project description! Separately, I used another cricket plus a heater connected to a tasmotized-sonoff outlet to keep plants in the garage from freezing. See below, where <code class="language-plaintext highlighter-rouge">sonoff_s31_lite_1</code> is the name of the switch that controls the heater. Target
temp of 38. I had to set a <code class="language-plaintext highlighter-rouge">keep_alive</code> of 3 minutes to keep the home-assistant
reading in sync with the switch (heater) state.</p>
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">sensor</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="na">name</span><span class="pi">:</span> <span class="s">cricket1_temp</span>
<span class="na">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">/cricket1/temp"</span>
<span class="na">unit_of_measurement</span><span class="pi">:</span> <span class="s1">'</span><span class="s">°C'</span>
<span class="na">device_class</span><span class="pi">:</span> <span class="s">temperature</span>
<span class="na">climate</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">platform</span><span class="pi">:</span> <span class="s">generic_thermostat</span>
<span class="na">unique_id</span><span class="pi">:</span> <span class="s">Garage Thermostat</span>
<span class="na">name</span><span class="pi">:</span> <span class="s">Garage</span>
<span class="na">heater</span><span class="pi">:</span> <span class="s">switch.sonoff_s31_lite_1</span>
<span class="na">initial_hvac_mode</span><span class="pi">:</span> <span class="s2">"</span><span class="s">heat"</span>
<span class="na">min_cycle_duration</span><span class="pi">:</span>
<span class="na">seconds</span><span class="pi">:</span> <span class="m">5</span>
<span class="na">keep_alive</span><span class="pi">:</span>
<span class="na">minutes</span><span class="pi">:</span> <span class="m">3</span>
<span class="na">target_sensor</span><span class="pi">:</span> <span class="s">sensor.cricket1_temp</span>
<span class="na">min_temp</span><span class="pi">:</span> <span class="m">34</span>
<span class="na">max_temp</span><span class="pi">:</span> <span class="m">70</span>
<span class="na">target_temp</span><span class="pi">:</span> <span class="m">38</span>
<span class="na">cold_tolerance</span><span class="pi">:</span> <span class="m">2</span>
</code></pre></div></div>David EargleMy first foray into IoT soil moisture sensing. Describes calibrating a moisture sensor, connecting it to a Cricket IoT esp32 board, and receiving mqtt moisture readings on Home-Assistant.Securing paypal “smart buttons” via shared-secret hash signatures2021-12-30T00:00:00+00:002021-12-30T00:00:00+00:00https://daveeargle.com/2021/12/30/paypal-secure-webhook-hash<p>Paypal promotes its <a href="https://paypal.com/buttons/smart">“smart buttons”</a> as a way to integrate purchasing on websites.<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup>
However, by default, all of their purchasing logic, including purchase amounts for
specific items, happens in the browser via javascript. This means that an attacker could edit
javascript and modify payment amounts. That’s a problem if the vendor sets
up webhook automation for paypal purchases to trigger business logic.</p>
<p>For example, the suggested code looks like this. Note that the amount is set on-page:</p>
<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">paypal</span><span class="p">.</span><span class="nx">Buttons</span><span class="p">({</span>
<span class="na">createOrder</span><span class="p">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">,</span> <span class="nx">actions</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="nx">actions</span><span class="p">.</span><span class="nx">order</span><span class="p">.</span><span class="nx">create</span><span class="p">({</span>
<span class="na">purchase_units</span><span class="p">:</span> <span class="p">[{</span>
<span class="dl">"</span><span class="s2">amount</span><span class="dl">"</span><span class="p">:</span> <span class="p">{</span>
<span class="dl">"</span><span class="s2">currency_code</span><span class="dl">"</span><span class="p">:</span> <span class="dl">"</span><span class="s2">USD</span><span class="dl">"</span><span class="p">,</span>
<span class="dl">"</span><span class="s2">value</span><span class="dl">"</span><span class="p">:</span> <span class="mi">40</span>
<span class="p">}}]</span>
<span class="p">});</span>
<span class="p">},</span>
<span class="c1">// ... snipped ...</span>
<span class="p">})</span>
</code></pre></div></div>
<p>To secure smart button transaction business logic, <a href="https://stackoverflow.com/questions/57878836/how-can-i-secure-transactions-made-with-client-side-paypal-smart-checkout-button">most</a> <a href="https://stackoverflow.com/questions/65361628/paypal-javascript-sdk-understand-security-problems-on-the-client-side?noredirect=1&lq=1">posts</a> on the internet that I saw suggest
that the only way to secure this is to have the paypal javascript
call server routes which do the actual order creation and validation. The server
saves validated order ids to a database, and any webhooks check that database
before performing business logic.<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup></p>
<p>That approach works. However, it requires a
database. But <a href="https://security-assignments.com/store">the security-assignments.com storefront</a>
is database-free, although it does use
some “serverless” cloud functions. My business logic adds email addresses to a restricted-access google group.
Customers pay (<code class="language-plaintext highlighter-rouge">amount</code>) to have their email addresses (<code class="language-plaintext highlighter-rouge">gcp_email</code>) added to that google group.</p>
<p>I am using two Google Cloud Functions: one for paypal order creation, and another for paypal
webhook processing.</p>
<p>I thought of a way using symmetric-encryption digital
signatures to authenticate paypal orders. It uses a shared secret (<code class="language-plaintext highlighter-rouge">shared_secret</code>) that both
google cloud functions have access to. The cloud function that creates the paypal order
saves the signature to the order metadata. The cloud function that handles the paypal webhook
checks that signature against its own calculation of the same.</p>
<p>My signature algorithm hashes three fields: (1) <code class="language-plaintext highlighter-rouge">gcp_email</code>, (2) <code class="language-plaintext highlighter-rouge">amount</code>, and (3) <code class="language-plaintext highlighter-rouge">shared_secret</code>.
Like this in python (<a href="https://github.com/security-assignments/paypal-create-order/blob/18f8a550ed621a9ac33427a08c2720ea61804ade/paypal_order.py#L35-L57">approximate code location</a>):</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">hashlib</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="n">m</span> <span class="o">=</span> <span class="n">hashlib</span><span class="p">.</span><span class="n">sha256</span><span class="p">()</span>
<span class="n">SHARED_SECRET</span> <span class="o">=</span> <span class="n">os</span><span class="p">.</span><span class="n">environ</span><span class="p">[</span><span class="s">'SHARED_SECRET'</span><span class="p">]</span>
<span class="n">hash_me</span> <span class="o">=</span> <span class="sa">f</span><span class="s">'</span><span class="si">{</span><span class="n">gcp_email</span><span class="si">}</span><span class="s">|</span><span class="si">{</span><span class="n">amount</span><span class="si">}</span><span class="s">|</span><span class="si">{</span><span class="n">SHARED_SECRET</span><span class="si">}</span><span class="s">'</span>
<span class="n">m</span><span class="p">.</span><span class="n">update</span><span class="p">(</span><span class="n">hash_me</span><span class="p">.</span><span class="n">encode</span><span class="p">())</span>
<span class="n">signature</span> <span class="o">=</span> <span class="n">m</span><span class="p">.</span><span class="n">hexdigest</span><span class="p">()</span>
<span class="c1"># add the signature to the paypal json
</span><span class="n">order_json</span> <span class="o">=</span> <span class="p">{</span>
<span class="s">"purchase_units"</span><span class="p">:</span> <span class="p">[{</span>
<span class="s">"custom_id"</span><span class="p">:</span> <span class="n">signature</span><span class="p">,</span>
<span class="s">"invoice_id"</span><span class="p">:</span> <span class="n">gcp_email</span><span class="p">,</span>
<span class="s">"amount"</span><span class="p">:</span> <span class="p">{</span>
<span class="s">"value"</span><span class="p">:</span> <span class="n">amount</span><span class="p">,</span>
<span class="s">"currency_code"</span><span class="p">:</span> <span class="s">"USD"</span>
<span class="p">},</span>
<span class="c1"># ... snipped ...
</span> <span class="p">}]</span>
<span class="c1"># ... snipped ...
</span><span class="p">}</span>
</code></pre></div></div>
<p>Then later, the paypal webhook checks the signature, before adding <code class="language-plaintext highlighter-rouge">gcp_email</code> to the google group (<a href="https://github.com/security-assignments/paypal-webhook/blob/409ab9b2320b5349122cd1433b4684052dbc3a82/main.py#L125-L134">approximate code location</a>):</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">webhook_event_json</span> <span class="o">=</span> <span class="n">request</span><span class="p">.</span><span class="n">get_json</span><span class="p">()</span>
<span class="n">custom_sig</span> <span class="o">=</span> <span class="n">webhook_event_json</span><span class="p">[</span><span class="s">'resource'</span><span class="p">][</span><span class="s">'custom_id'</span><span class="p">]</span>
<span class="k">def</span> <span class="nf">custom_sig_verify</span><span class="p">(</span><span class="n">gcp_email</span><span class="p">,</span> <span class="n">amount</span><span class="p">,</span> <span class="n">custom_sig</span><span class="p">):</span>
<span class="n">SHARED_SECRET</span> <span class="o">=</span> <span class="n">os</span><span class="p">.</span><span class="n">environ</span><span class="p">[</span><span class="s">'PAYPAL_SHARED_SECRET'</span><span class="p">]</span>
<span class="n">hash_me</span> <span class="o">=</span> <span class="sa">f</span><span class="s">'</span><span class="si">{</span><span class="n">gcp_email</span><span class="si">}</span><span class="s">|</span><span class="si">{</span><span class="n">amount</span><span class="si">}</span><span class="s">|</span><span class="si">{</span><span class="n">SHARED_SECRET</span><span class="si">}</span><span class="s">'</span>
<span class="n">m</span> <span class="o">=</span> <span class="n">hashlib</span><span class="p">.</span><span class="n">sha256</span><span class="p">()</span>
<span class="n">m</span><span class="p">.</span><span class="n">update</span><span class="p">(</span><span class="n">hash_me</span><span class="p">.</span><span class="n">encode</span><span class="p">())</span>
<span class="n">sig</span> <span class="o">=</span> <span class="n">m</span><span class="p">.</span><span class="n">hexdigest</span><span class="p">()</span>
<span class="k">return</span> <span class="n">sig</span> <span class="o">==</span> <span class="n">custom_sig</span>
</code></pre></div></div>
<p>The paypal javascript on <a href="https://security-assignments.com/store">https://security-assignments.com/store</a> calls the
first webhook to create the order, and doesn’t do any server-side processing for
the approval step. Similar to this:</p>
<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">paypal</span><span class="p">.</span><span class="nx">Buttons</span><span class="p">({</span>
<span class="na">createOrder</span><span class="p">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">,</span> <span class="nx">actions</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="nx">fetch</span><span class="p">(</span><span class="nx">gcp_cloud_function_paypal_order_create_endpoint</span><span class="p">,</span> <span class="p">{</span>
<span class="na">method</span><span class="p">:</span> <span class="dl">'</span><span class="s1">post</span><span class="dl">'</span><span class="p">,</span>
<span class="na">headers</span><span class="p">:</span> <span class="p">{</span>
<span class="dl">'</span><span class="s1">content-type</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">application/json</span><span class="dl">'</span>
<span class="p">},</span>
<span class="na">body</span><span class="p">:</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">({</span><span class="dl">'</span><span class="s1">gcp_email</span><span class="dl">'</span><span class="p">:</span> <span class="nx">gcp_email</span><span class="p">,</span> <span class="dl">'</span><span class="s1">paypal_mode</span><span class="dl">'</span><span class="p">:</span> <span class="nx">PAYPAL_MODE</span><span class="p">})</span>
<span class="p">}).</span><span class="nx">then</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">res</span><span class="p">){</span>
<span class="k">return</span> <span class="nx">res</span><span class="p">.</span><span class="nx">json</span><span class="p">()</span>
<span class="p">}).</span><span class="nx">then</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">){</span>
<span class="k">return</span> <span class="nx">data</span><span class="p">.</span><span class="nx">id</span>
<span class="p">})</span>
<span class="p">},</span>
<span class="na">onApprove</span><span class="p">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">,</span> <span class="nx">actions</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="nx">actions</span><span class="p">.</span><span class="nx">order</span><span class="p">.</span><span class="nx">capture</span><span class="p">().</span><span class="nx">then</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">orderData</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// Full available details</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="dl">'</span><span class="s1">Capture result</span><span class="dl">'</span><span class="p">,</span> <span class="nx">orderData</span><span class="p">,</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">orderData</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="mi">2</span><span class="p">));</span>
<span class="c1">// ...snipped...</span>
<span class="p">});</span>
<span class="p">},</span>
<span class="p">})</span>
</code></pre></div></div>
<p>Tada! No database!</p>
<p>Since my paypal client-id is still in the sourcecode, an attacker could still
craft api calls and be annoying and pay me whatever they wanted, and I would
have the inconvenience of having to refund their order. But the business logic
would never trigger.</p>
<p>Go on and <a href="https://twitter.com/racheltobac/status/1448732967967223816?lang=en">F12</a> <a href="https://security-assignments.com/store">https://security-assignments.com/store</a>!</p>
<hr />
<p>Links to the source code repos below. If you see a problem or an improvement, please open an issue on the repos!</p>
<p><a class="btn btn-success" href="https://github.com/security-assignments/paypal-create-order">Go to paypal order creation repo</a></p>
<p><a class="btn btn-success" href="https://github.com/security-assignments/paypal-webhook">Go to the paypal webhook repo</a></p>
<hr />
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:1" role="doc-endnote">
<p>If you don’t need any fancy modification, I suggest using their “buy now”
<a href="https://www.paypal.com/buttons/">hosted buttons</a>. Since the button logic is
hosted on paypal.com servers, the buttons are secure against client-side
modification. You won’t find that page linked from hardly anywhere on
paypal.com, though! <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:2" role="doc-endnote">
<p>The other button security solution I saw on paypal requires Java and is
<a href="https://developer.paypal.com/api/nvp-soap/paypal-payments-standard/integration-guide/encryptedwebpayments/">legacy</a>. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>David EarglePaypal promotes its “smart buttons” as a way to integrate purchasing on websites.1 However, by default, all of their purchasing logic, including purchase amounts for specific items, happens in the browser via javascript. This means that an attacker could edit javascript and modify payment amounts. That’s a problem if the vendor sets up webhook automation for paypal purchases to trigger business logic. If you don’t need any fancy modification, I suggest using their “buy now” ↩New tool: Ebscohost query maker2021-12-06T00:00:00+00:002021-12-06T00:00:00+00:00https://daveeargle.com/2021/12/06/ebscohost-query-maker<p>Searching ebscohost for a collection of specific journals is horrible, so I made
it palatable.</p>
<p><a class="btn btn-primary" href="https://daveeargle.com/ebscohost-query-maker/">Tool webpage</a></p>
<p><a class="btn btn-outline-primary" href="https://github.com/deargle/ebscohost-query-maker/">Tool source code</a></p>David EargleSearching ebscohost for a collection of specific journals is horrible, so I made it palatable.Kali-on-GCP updated for Kali 2021.22021-08-17T00:00:00+00:002021-08-17T00:00:00+00:00https://daveeargle.com/2021/08/17/Kali-2021-2-on-GCP<div class="page-header text-center well">
<h2>
<a class="btn btn-primary" href="https://github.com/deargle/kali-on-gcp">Go to the repo</a>
</h2>
</div>
<p>Not especially exciting, but I just updated my Kali on GCP repo so that it builds
<code class="language-plaintext highlighter-rouge">2021.2</code>. This time around, I didn’t have to downgrade the openssl packages in
order to get gcp-ssh-in-the-browser to work. Maybe that’s because the openssl package
that 2021.2 currently uses is <em>available</em> for Debian 10 (although a lower version
is installed by default). Regardless, the only changes I had to make were some
grub-file edits, and installing the google gcp packages.</p>
<p>I dropped packer files for previous Kali builds from the repo, since they no
longer successfully complete the install process, due to how the kali rolling
apt package structure works.</p>David EargleGo to the repoMetasploitable2 in vagrant2021-08-12T00:00:00+00:002021-08-12T00:00:00+00:00https://daveeargle.com/2021/08/12/Metasploitable2-in-vagrant<div class="page-header text-center well">
<h2>
<a class="btn btn-primary" href="https://github.com/deargle/lab-metasploitable2">Go to the repo</a>
</h2>
</div>
<p>It’s interesting to me how much time I just spent figuring out how to do something I just did two (three?) years ago.
Back then, I started working on a “devops” approach to a virtual machine kali pentest lab. That meant documenting
– and scripting, as far as possible – each step. DevOps starts from as early in the chain as possible – from an installation iso (starting with <code class="language-plaintext highlighter-rouge">packer</code> in that case), a vagrant base box, or for Metasploitable2, the Rapid-7 “golden-image” vmdk file. And ending with the deployed vagrant images that I have students use.</p>
<p>Except apparently I didn’t document anything about how I made a libvirt vagrant provider Metasploitable2. I <em>could</em> have <code class="language-plaintext highlighter-rouge">vagrant-migrate</code>d one of the metasploitable2 boxes on vagrantcloud built for different providers. But that felt
too fragile – too far removed from the origin. And why take the easy road when you can spend 10x as long
doing it yourself!</p>
<p>There were some show-stopper problems. The interesting part is that when
I hit these gotchas, I had no recollection of hitting them before. But I <em>did</em> have my
already-working Metasploitable2 libvirt box to reference. It was basically my own golden image on top of the Rapid7
golden image –
a disk that I got working at one point, but couldn’t replicate the steps. It “just worked.” That’s
anti-devops.</p>
<p>So I’d hit a problem, and then scratch my head and say, “well how did I do it with this golden image?”.
But few hints jumped to mind. So I found myself starting from ground zero – web-searching<sup><a href="#footnote-1">*</a></sup>
promising pieces of the error messages, combing through forums, curating potential solutions using my fathomless life experiences.
I’d look at a potential solution and then say, “this looks promising…
does it look like I did this with the golden image?” and if yes, I applied the step
to the original image, created a new vagrant box, and saw whether it worked.</p>
<p>For example, look at this error:</p>
<div class="">
<a href="/assets/img/metasploitable2-disk-check-fail.png" target="_blank">
<img src="/assets/img/metasploitable2-disk-check-fail.png" class="shadow-sm img-fluid img-thumbnail mb-2" width="600px" alt="metasploitable2 disk check fail" />
</a></div>
<p>My hints:</p>
<ol>
<li>When I created an image in virt-manager by using the metasploitable2 vmdk source disk directly,
this error did not appear.</li>
<li>However, when I used <code class="language-plaintext highlighter-rouge">qemu-img convert</code> to change the .vmdk to a .qcow2 format, followed by using <a href="https://github.com/vagrant-libvirt/vagrant-libvirt/blob/cf51e451a0fc80605aae952137af457a27bfe885/tools/create_box.sh">this create_box.sh script</a>
to package the qcow2 into a vagrant box, then followed by <code class="language-plaintext highlighter-rouge">up</code>ing a new vagrant instance referencing that box,
the above error appeared.</li>
</ol>
<p>Suspicion: Was <code class="language-plaintext highlighter-rouge">qemu-img convert</code> corrupting the disk?</p>
<ul>
<li>Test: I created a vm instance directly from the qcow2 file created by <code class="language-plaintext highlighter-rouge">qemu-img convert</code>. The error did not appear.</li>
<li>Conclusion: No, <code class="language-plaintext highlighter-rouge">qemu-img convert</code> was not corrupting the disk.</li>
</ul>
<p>Suspicion: Was <code class="language-plaintext highlighter-rouge">create_box.sh</code> corrupting the disk?</p>
<ul>
<li>Test: I examined the source code. It didn’t do anything noteworthy to the disk – it basically
just bundled the disk alongside vagrantfile defaults.</li>
</ul>
<p>Suspicion: Were the vagrantfile defaults set by <code class="language-plaintext highlighter-rouge">create_box.sh</code> messing things up?</p>
<ul>
<li>Test: I looked at documentation for each default that was set. I also looked at output during <code class="language-plaintext highlighter-rouge">vagrant up</code> on the working vagrant box for differences. No differences found.</li>
<li>Conclusion: the vagrantfile wasn’t impacting anything.</li>
</ul>
<p>Suspicion: I remembered something nagging about <code class="language-plaintext highlighter-rouge">/etc/fstab</code>, from previous boxes I’d made. I then read the error message in
the image above more closely. It wasn’t saying
the disk was necessarily corrupt. Rather, it was saying it couldn’t find <code class="language-plaintext highlighter-rouge">/dev/sda.</code></p>
<ul>
<li>Hrm! That aligned with my nagging about <code class="language-plaintext highlighter-rouge">/etc/fstab</code>. I looked for differences between the broken and golden <code class="language-plaintext highlighter-rouge">device_bus</code> settings from virt-manager details inspector. One
was IDE and the other was VirtIO. What <code class="language-plaintext highlighter-rouge">vagrant-libvirt</code> settings drove that difference? Could that be the issue? How does the OS know what kind of device is mounted?</li>
<li>I skimmed lightly through the <code class="language-plaintext highlighter-rouge">vagrant-libvirt</code> and <code class="language-plaintext highlighter-rouge">libvirt</code> documentation for things related to the disk. Ah! VirtIO mounts
the disk as <code class="language-plaintext highlighter-rouge">/dev/vda</code>, while IDE mounts it as <code class="language-plaintext highlighter-rouge">/dev/sda</code>. And indeed, there was an entry in the broken-image <code class="language-plaintext highlighter-rouge">/etc/fstab</code> looking
for the <code class="language-plaintext highlighter-rouge">sda</code> variant. And in the golden image, I had apparently changed it to look for <code class="language-plaintext highlighter-rouge">vda</code>.</li>
<li>Generalizable solution: I deleted that <code class="language-plaintext highlighter-rouge">/etc/fstab</code> entry from the base vmdk, then re-converted and re-vagrant-packaged and re-added. This worked.</li>
</ul>
<p>Solved.</p>
<p>I had to go through similar troubleshooting to realize that <code class="language-plaintext highlighter-rouge">msfadmin</code> needed passwordless-sudo so that vagrant-libvirt
could ssh in and add a second network adapter. That took another few hours, but lo, it turns out I had done that in the golden image
at some point. No memory of that! Weird! But I remembered – from hints while web-searching – that that was a common step required when setting the conventional <code class="language-plaintext highlighter-rouge">vagrant</code> user on a vagrant base box.</p>
<p>Again, meta-cognitively, the interesting part was my having no memory of having already done these steps.
Maybe I’m getting old. Or maybe I did the original steps so late at night that they hadn’t entered long-term memory,
if that is a thing. :shrug:</p>
<p>I have documented the build process <a href="https://github.com/deargle/lab-metasploitable2">in this github repo</a>.</p>
<hr />
<p><a name="footnote-1">*</a> trying my best to not say “google-searching”. Except, duckduckgo sucked at guessing
that I was looking for <a href="https://github.com/vagrant-libvirt/vagrant-libvirt">the vagrant-libvirt project landing page – its github repo</a> – when I searched <code class="language-plaintext highlighter-rouge">vagrant-libvirt</code> – that repo’s
<em>readme</em> is the seventh hit for that search. Where the root of the repo is the
<em>first</em> hit for a google search. So, hat tip to google for coding searching, I guess.</p>
<div class="">
<a href="/assets/img/vagrant-libvirt-google.png" target="_blank">
<img src="/assets/img/vagrant-libvirt-google.png" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="vagrant-libvirt-google" />
</a></div>
<div class="">
<a href="/assets/img/vagrant-libvirt-duckduckgo.png" target="_blank">
<img src="/assets/img/vagrant-libvirt-duckduckgo.png" class="shadow-sm img-fluid img-thumbnail mb-2" width="400px" alt="vagrant-libvirt-duckduckgo" />
</a></div>David EargleGo to the repoClass GPA Calculator2021-07-22T00:00:00+00:002021-07-22T00:00:00+00:00https://daveeargle.com/2021/07/22/Class-GPA-Calculator<p><em>Some schools have guidelines for distribution of letter grades for a class. Announcing a tool that helps with compliance with those guidelines.</em></p>
<div class="page-header text-center well">
<h2>
<a class="btn btn-primary" href="https://daveeargle.com/mandatory-grading-guidelines/">Go to the tool</a>
</h2>
</div>
<hr />
<p>Letter grades in college are supposed to be an efficient signal of how well students are mastering course material.</p>
<p>For a school evaluating a group of students all going through the same program – say, a group of
second-years are being considered for scholarships – GPAs can be more useful. Unless all students
are getting the <em>same</em> GPAs. Without variance, there can’t be meaningful discrimination by that metric.</p>
<p>Cross-schools, they’re arguably useless for differentiating students. There’s no standardization between schools
on how individual course grades are assigned. I think this is <em>the</em> reason why standardized testing exists (e.g., ACT, SAT, GMAT, TSOL). It’s supposed
to be the same test for everyone. If you can control for the test, then differences between
students have meaning, even comparing across groups.</p>
<p>Grade curves can be useful for classes with multiple sections, taught by different instructors. In this
case, curving can erase differences in teaching aptitude etc. <a href="https://www.reddit.com/r/cuboulder/comments/gdh983/does_this_warrant_talking_to_the_department_head/fphd63u/?context=3">I wrote about this</a> on <a href="https://www.reddit.com/r/cuboulder/">/r/cuboulder</a> once,
in response to a student took a section of a large, required course, taught by a grad student. The student concerned that they would get an unfairly low grade:</p>
<blockquote>
<p>Hi, I’m a prof. Will there be a curve for this class? This is one of the things that curves are intended to help fix – problems with different grading standards, different test difficulties, etc among sections of classes (or among different classes in a school). If one section has an ultra-hard exam with a D average, and another section for the same class has an A average, then an across-section curve would in theory make it so that a student’s grade was not determined merely by a dice-roll of which instructor a student got for a section.</p>
<p>An aside from the perspective of an instructor – assessing knowledge is not easy, and writing exams is hard. Judging what a student should know is subjective, and takes experience – it takes semesters of teaching the same course, or it can partly be remedied by borrowing testing materials from others in the department or whomever has taught the same course. That’s another thing curves are supposed to help – help with the learning curve of writing assessments. Or an instructor gets “lucky” and finds a textbook which has pre-written exam questions, and they can just require the textbook for the course and use the exam questions, done. Cheese, and \(\)$$$ for students, but that’s part of the appeal of textbooks to instructors. But no textbook, then instructor has to write all assessments themselves. And there is no real training on how to do that. Grad programs are about how to do research, not about pedagogy.</p>
<p>Another friendly nitpick, a “professor” is someone with a phd, in that someone with a phd “professes” to be an expert in a field. I was thrown for a minute by dissonant impossibility of someone with a phd being a grad student in their own field. lol.</p>
<p>But I would wait to see what the final posted grade will be. If it seems unduly low, then that would be the time to appeal to a department head. And bless your heart for going to the department head first instead of straight to the dean. That’s the correct path for appeals, and saves a lot of organizational headache for everyone involved. Appeal straight to the dean and the dean is going to refer it to the department head.</p>
</blockquote>
<p>Adding to the above: some professors might snub their noses at a school and assign all A’s, as a lazy way out of more careful grading work. Or, maybe a professor is developing a new course, and they haven’t honed their exam material yet. Good exams differentiate between students – with bad exam questions, either everyone gets it right, or everyone gets it wrong, or it’s a tossup on who gets it right or wrong. Maybe students in one year do better with certain material than in the next year, because perhaps the professor got better at teaching it, or perhaps because students cheated. Should students who do equally well on a class across years get the same grade? Holding exam, teaching method, teaching quality, and all else constant?</p>
<hr />
<p>The thing that really gets students worried is a fear that they won’t get a job because of their GPA. At employment time, students might be compared against
candidates from different schools. I don’t see how minute differences in GPAs can be useful for discriminating between applicants from different schools. Regardless, GPAs might be used by an employer to do a rough first cut of job applicants. Even if those
applicants come from different schools. That’s lazy of an employer – a standardized test would be better –
but it’s a lot cheaper than interviewing every candidate. And perhaps the practice signals to the candidate that an employer isn’t a good match. An employer <em>could</em> more reasonably
compare two candidates from the same college program by their GPA. Again, as long as there is variance! If everyone has 4.0’s,
then this approach would never work.</p>
<p>Again, <a href="https://www.dailycamera.com/2015/12/08/unrest-over-grade-guidelines-pressures-cu-boulders-business-school/">some</a> <a href="https://www.change.org/p/david-l-ikenberry-faculty-at-cu-boulder-leeds-help-change-the-grading-guidelines-at-leeds-school-of-business-cu-boulder">students</a> <a href="https://www.cuindependent.com/2016/02/22/the-debate-over-leeds-grading-guidelines-explained/">get</a> worried.</p>
<p>That’s too abstract! We have a business (a business school) to run. Let’s get to it! Faculty in a school need a target for grade distributions.
Here’s <a href="https://www.colorado.edu/business/current-students/academic-advising/undergraduate-degree-information/grading-guidelines">Leeds’</a>:</p>
<blockquote>
<p>Average course grades should not exceed:</p>
<p>3.0 (1000‐2000 level courses)
3.0 (3000 level courses)
3.2 (4000 level courses)</p>
</blockquote>
<p>These guidelines have been in place since I arrived at Leeds. But how to do this, practically? Default gradebooks (we use Canvas LMS) track grades on a 100-point
scale. I have a “problem” where I give “good” exams (high variance) with <em>very low</em> average scores (we’re talking 50% median, ouch). So before curving, my class GPAs might be <em>way below</em> the 3.2-or-whatever mark. I <em>could</em> leave grades there, but I’m not a monster, so I curve up. (I also try to not let students see their uncurved grades, because I’m still a young, not-yet-heartless professor.)</p>
<p>My typical approach is this:</p>
<ul>
<li>start with students’ final 100-pt grades. Download as a csv from Canvas.</li>
<li>Use a vlookup table to convert 100 pt grades to a letter grade.</li>
<li>Use another v-lookup to convert letter grades to 4.0-scale grades.</li>
<li>
<p>Compute the average of the latter.</p>
<p>If way below target:</p>
<ul>
<li>add <code class="language-plaintext highlighter-rouge">x</code> points to all students’ final 100-pt grades, and observe the new 4.0 average.</li>
<li>Set up an excel goal-seek to set the 4.0-scale average to some value by changing the <code class="language-plaintext highlighter-rouge">x</code>-pt curve.</li>
</ul>
</li>
</ul>
<p>But that’s tedious, especially because any change on the Canvas side means downloading the gradebook anew as a csv and doing all the prep
work on my excel formulas. And something being tedious means… time to spend way too many hours automating what could be error-prone
done in far shorter time! And then… share it with the internet, and get internet points!</p>
<div class="page-header text-center well">
<h2>
:tada: <a class="btn btn-primary" href="https://daveeargle.com/mandatory-grading-guidelines/">Behold, a Grade Curvinator!</a> :tada:
</h2>
</div>David EargleSome schools have guidelines for distribution of letter grades for a class. Announcing a tool that helps with compliance with those guidelines.Text-searchable mapping of NIST Cybersecurity Framework Core to 800-53 Controls2020-11-03T00:00:00+00:002020-11-03T00:00:00+00:00https://daveeargle.com/2020/11/03/NIST-CSF-800-53-Mapping<div class="page-header text-center well"><h2>
<a class="btn btn-primary" href="https://daveeargle.com/nist_csf_800_53_mapping/">Go to the tool</a></h2></div>
<p>I rent my cloak asunder in frustration when I realized I couldn’t ctrl+f the
<a href="https://www.nist.gov/cyberframework">NIST Cybersecurity Framework</a> Core for
“penetration testing” or “encryption” or for anything, really, making it
impossible to go from knowing security technical stuff to understanding quickly
where a given control would fit into the core. So I wrestled with the 800-53 XML
for a few days and got it into a format that could be javascript-searched in a
webpage-table. Now I need a new cloak, but at least I have a table. I may post
feature updates to the table from time to time.</p>
<p><a href="https://github.com/deargle/nist_csf_800_53_mapping">Here’s</a> all my python scripts for parsing the various NIST source
files and for preparing the datasource used by the html table. Hopefully my use
of python scripts will make updating the table relatively easy as new CSF or
800-53 versions are released.</p>David EargleGo to the toolTranscription of Crown Sterling Time AI Blackhat 2019 Q&A Session2020-09-30T00:00:00+00:002020-09-30T00:00:00+00:00https://daveeargle.com/2020/09/30/blackhat-crown-sterling-q-and-a-transcription<p>For use in teaching asymmetric cryptography to
b-school students via an injection of snake oil. A transcription of audio from
a recording (<a href="https://www.youtube.com/watch?v=oPiWqWJHz8E">part 1</a>, <a href="https://www.youtube.com/watch?v=3nSOp9OfGtg">part 2</a>) of Robert Grant’s
BlackHat 2019 presentation about Time AI. Read <a href="https://www.schneier.com/blog/archives/2019/09/the_doghouse_cr_1.html">Bruce Schneier’s coverage</a> and links therein for context.</p>
<p>All not-italicized text is Robert Grant.</p>
<p>Please submit a PR if you can make out the parts that were unintelligible to me!</p>
<hr />
<p>[<a href="https://www.youtube.com/watch?v=oPiWqWJHz8E">Part 1</a> 26:22, start of Q&A session]</p>
<p>So this morning undersecretary Mike Griffin said on his twitter feed, “what I
want to bet on is the ability of the united states and our western allies to
out-innovate our adversaries.” I think that’s really important and it’s not just
a national level but I’m excited for Time[.AI]’s timeliness to be able to impact
[… unintelligible …] so we will go after the new market but the market is so
large already that nobody knows encryption… rant… like, nobody knew botox but
everyone wanted a botox grant but this is something that I think is so important
about sovereignty. So with that I’ll open the time to just a couple of questions
real quick. Yes, go ahead,</p>
<p><em>Speaker 1: […] I understand correctly that all encryption is based on</em>
<em>factorization</em> [yeah]<em>… including Diffie-Hellmann…</em></p>
<p>Diffie-Hellman exchange, that’s… more of the exchange methodology and I think
a lot of people refer to that but yes it’s all based on factorization of prime
numbers. including Diffie-Hellman, including RSA, including elliptic curve.</p>
<p><em>Speaker 1: AES too?</em></p>
<p>AES is not! I’m talking about all asymmetric key, um, encryption.</p>
<p><em>Speaker 1: So are you aware this is wrong.</em> [Sorry?] <em>Diffie-Hellmann is based</em>
<em>on discrete logarithm.</em> [Sorry I can’t – parle france?] <em>Oui oui oui.</em></p>
<p>Okay [chuckles]. So, but you can use Diffie-Hellmann exchange for public key
cryptography too. I’m talking about public key cryptography, and asymmetric…
key. Right? So that’s different. Symmetric key is great. AES encryption,
fabulous, no issues there. In fact, Time.AI converts… ah, all of the data that’s
transferred into an AES encryption automatically so it’s embedded within it. Yes.</p>
<p><em>Speaker 2: So, can you uh … [unintelligible] which is, you can determine whether
a number is composite or prime using your new method.</em> [Yes.] <em>Um, how does that compare to AKS?</em></p>
<p>Um, I haven’t used AKS so I can’t say that I can compare it. But I can tell you
that we don’t have to go from the other way around, which is you don’t have to
start from the number and work backwards, we can predict from the beginning,
outwards. Right. So, we know its position. Now we’ve also done other analysis
and found that there’s a mirror reflection on when quasi primes show up versus
prime numbers. And it’s around the number… six.</p>
<p><em>Speaker 2: I may have misspoke. I mean if I were to give you a number and ask</em>
<em>you if the number was prime, you’re able to use your method to determine that.</em>
[Oh absolutely] <em>And do you have like Big O notation like the worst-case for how</em>
<em>long it would take to determine the number…</em>[interrupted]</p>
<p>We haven’t done any speed tests on that yet. Again, once we knew that an index
could be created, ah, for this, we immediately went to developing the new
encryption. Ah, but we have actually worked with the amount of time that it
takes, so we know, ah we also want to be really responsible about this, it’s not
really about factorizing anymore, I believe there’s going to be – very shortly
– equations. Not algorithms, but equations – that actually geometrically solve
the solution of this entanglement problem between sum and product. Yes.</p>
<p><em>Speaker 3: On the day that those equations are found, will you release those publicly?</em></p>
<p>That’s a good question, but I can tell you that there’s a lot of people that
would be very sensitive to this particular topic.</p>
<p><em>Speaker 3: Not the equations, your technology. If there was an equation which</em>
<em>breaks all encryption, will you release your encryption.</em></p>
<p>Well, not all encryption – public key, right, anything factor based, right.
Would we release our encryption’s equation? It depends. I don’t know the answer
to that question. We have considered doing white papers on our encryption. There
are certain… parties… that we’re in talks with right now that may not want
us to do that. I can tell you that Microsoft is working on a non-factor-based
encryption I’ve heard about. I’ve heard Google working on it too. I don’t think
they’ve been publishing that. So I think that that whole concept of, you know,
Kerchoff principle etcetera, I think is going to be challenged very soon,
because, people are really starting to look at this as trade secret, more than
anything else. So I can’t answer that question right now, and I don’t want to
venture it right now, because I can’t say what our partners would want. We’re
looking at doing partnership with several companies right now, many of whom you
would know.</p>
<p><em>Speaker 4: [unintelligible] Microsoft and google are working on that,</em>
<em>[unintelligible] poster page in 1976, [unintelligible]</em></p>
<p>Actually they just went back to one, probably because they know about this prime
factor issue, they went back to the 60’s.</p>
<p><em>Speaker 4: [unintelligible] 1978, asymmetric encryption based on things other</em>
<em>than factorization… [unintelligible]… maybe there is a bit of pure art.</em>
<em>Possibly, [unintelligible] prime numbers, there is a bit of pure art,</em>
<em>[unintelligible] so it was described and published 23 centuries ago.</em>
<em>So maybe you should… Google some of…</em></p>
<p>Yeah yeah that’s part of it, but the quasi prime was not. So the prediction of
prime numbers was not. Actually, the first time that anyone published the issue
of the 24 hour clock, which was not our invention, we cite in our paper,
Peter Plichta who actually published that, I think in the 90’s, he’s an old
chemist from Germany, but the advent of the quasi prime, and being able to
predict primes was only in this year.</p>
<p>One last question then we gotta go.</p>
<p><em>Speaker 5: So during your talk, you made allegations that RSA might not have a</em>
<em>problem in fact.</em></p>
<p>Not just RSA, right, I’m not talking about the company RSA, I’m only talking
about general factor based encryption. <em>[Right.]</em> Public key.</p>
<p><em>Speaker 5: Right. Can you substantiate that will some numbers, like, the</em>
<em>security level – how significantly has it dropped?</em></p>
<p>I cannot, and I will not here. I can just say to you that… there was a great
article that came out in the Economist last October, I can’t remember the name
of the guy that wrote the article, but it basically was called,
“Prime factorization… Quantum computers will break Prime Factorization.” But in
the second paragraph it says, “in addition to quantum computers, any one of the
millions of the professional and amateur mathematicians might have a stroke of
inspiration tomorrow, publish an equation that unravels it.” I think that is
actually more likely than what we’re talking about from a timeline perspective
for when quantum computers are going to come out.</p>
<p><em>Speaker 5: How come you’re not following the standard procedure in academia</em>
<em>where when there are findings in cryptanalysis, they are published?</em></p>
<p>Because I don’t have to.</p>
<p><em>Audience murmur: Come on, man.</em></p>
<p><em>Dan Guido, CEO of Trail of Bits: You uploaded that document to a website so you could get it</em>
<em>reviewed though. You said you put it on a website that was Cornell-affiliated.</em>
<em>And that’s Arxiv. That’s like me saying I put information on Google Docs, so</em>
<em>Google reviewed it. You’re lying!</em></p>
<p>No I’m not.</p>
<p><em>Dan: This is a scam!</em></p>
<p>No it’s not.</p>
<p><em>Dan: It’s a scam, and you’re just using marketing material from this to trick a</em>
<em>bunch of people months later, you’ll say you’re legitimate because you spoke at</em>
<em>Black Hat. You should be ashamed of yourself, and all of you working for him</em>
<em>should quit your…</em></p>
<p>[video break, start <a href="https://www.youtube.com/watch?v=3nSOp9OfGtg">Part 2</a>]</p>
<p><em>Dan: …somebody with a moderate knowledge of mathematics, […] every single thing</em>
<em>you just said.</em></p>
<p>No, no. I’m sorry. I did not say, that all encryption is. I said factor-based
encryptions. <em>Yeah!</em> Don’t lie, no. No, please. Please. So I’m just saying this,
I’m just saying, you know what…</p>
<p><em>Dan: You shouldn’t be here. You shouldn’t be here, you should be ashamed of yourself.</em></p>
<p>You can say whatever you like, you’re entitled, you know what…</p>
<p><em>Audience member: Well let’s not be rude, alright, let’s just not be rude, let’s be respectable.</em></p>
<p><em>Audience member 2, addressing Dan: Who do you work for? Who do you work for!</em></p>
<p><em>Dan: Who do I work for?! I run a cryptography team!</em></p>
<p>So. Please have him removed.</p>
<p>[A burly man, who does not appear to be affiliated with Black Hat, removes him, without laying hands on him.]</p>
<p>So, the point is that, we don’t claim to know everything. Okay. All I can tell you is that we strongly believe that this new encryption is a great approach to be able to benefit consumers, it’s a novel approach, it’s real, it works as an encryption, and we will subject ourselves to regular testing. Right, we absolutely! And if it makes sense for us to publish it, right, because our partners who are reviewing it right now want us to, I’m more than happy to do that. But I’m just saying I want to handle this in a stepwise fashion. And as it relates to an equation that comes out for factorization, right, or speed of factorization tests etcetera, we’ll subject ourselves to all that too. But, we want to do it in a stepwise fashion. You have to be responsible. I wouldn’t even have gotten into this encryption field if I didn’t feel like it was absolutely necessary. The last thing you want to do is come up with some discovery, then all the sudden have everyone tell you, dude, you just like screwed up this stuff. So we’ve been relatively quiet about it on purpose. But now we’ve got an encryption that’s working, that’s great, we’d like you guys to try it, and it’s gonna have to stand on its own merit, just like every other encryption. So of course there’s gonna be people that are going to have their own skeptical position [gesturing towards door], it is what it is. But you know what, those are usually people who don’t create anything.</p>
<p>Thank you very much.</p>David EargleFor use in teaching asymmetric cryptography to b-school students via an injection of snake oil. A transcription of audio from a recording (part 1, part 2) of Robert Grant’s BlackHat 2019 presentation about Time AI. Read Bruce Schneier’s coverage and links therein for context.